Articles of posts

Custom wordpress loop

I’m trying to list posts in a custom post type, within a layout like following. html for below layout like this. <div class=”col-md-4 col-sm-6″> PROFILE – 1 </div> <div class=”col-md-4 col-sm-6″> </div> <div class=”col-md-4 col-sm-6″> PROFILE – 2 </div> <div class=”col-md-4 col-sm-6″> PROFILE – 3 </div> <div class=”col-md-4 col-sm-6″> </div> <div class=”col-md-4 col-sm-6″> PROFILE – […]

Random posts that always include a particular post?

How can I always include a post/ page in the random result? For instance, I always want to get 3 items only from my articles. But I want the result always has the article with page order 1: $parent = $post->ID; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $query_args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ […]

Post is blank when I click on the link

As I’m adding posts to a new website, the link is showing up on the page as I wanted them to. http://fohh.vavee.com/anniversary-celebration The problem is that when I click on the link I end up with a blank frame with no content. http://fohh.vavee.com/’/2017/06/24/harmony-hall-launches-10th-anniversary-celebration/’ Is this as simple as a function that I haven’t enabled or […]

Pagination for single post

I would like to make my pagination for single post look like this: and not like that….. I am using wordpress and for pagination in single post i using the quicktag. Theme is MH Magazine liteVersion: 2.5.3

Count the number of a post types associated with another post type

I have 2 custom post types in WordPress: Destinations and Tours (so say Paris and Day Trip to Paris). They have a many to many relationship. Now I need to count the number of tours associated with the individual destinations like, Paris(2), Rome(5) etc. I tried to use this wp_count_posts(‘tour’); but this gets the total […]

Avoiding “Missed Schedule” errors when inserting future posts

I’m inserting future posts as you’d expect using a post_status of future and a future post_date and post_date_gmt. The dates look fine in WordPress, but these posts appear with the “Missed Schedule” warning. They haven’t missed schedule yet because they’re future posts. My guess is that it’s because when inserting these future posts I’m not […]

White screen of death on post save only

I’ve worked in WordPress many years and never seen this particular behaviour. The white screen of death only shows on Post Publish or Update. It doesn’t show on WooCommerce Category additions. It doesn’t show on plugin additions, etc. The front side of the site shows just fine. No PHP error shows with WP_DEBUG is set […]

Post status doesn't update to 'future' every time?

My plugin is on two wordpress sites. The ‘main’ site sends a post to the child site. The child site receives the post via request to admin-post.php and inserts it as scheduled(future) to be published after some time with new title. Everytime the ‘process’ works, post is received and inserted, the title is changed BUT… […]

How to set the mainpage of a custom post type?

I just created a new custom post type to contain all the individual posts of the event im hosting. I want the slug for each post to be: myurl.co/conference/programitem I already got a page with the url: myurl.co/conference/ which i want to be the mainpage of this particular slug. (On this page some other information […]

Need to know custom code to display random and most viewed posts in wordpress posts and pages

My focus is to use custom but an optimized code to display random and top posts/pages in my WordPress. I have seen some recommendations where people refer to plugins, but I need codes/query only.