Show all posts using the template page and the loop?
Show all posts using the template page and the loop?
Show all posts using the template page and the loop?
This is a bandaid, not a fix. But it seems there is a bug within WP_Query, so I had to modify the query right before it was actually run in order for the post_type parameter to not be ignored. 1) I changed get_posts() to a WP_Query 2) I added this to my functions.php file: function … Read more
I can already see a problem. It is your use of switch_to_blog(). You are potentially doing multiple switch_to_blog() calls; calling restore_current_blog() once at the end of the loop is meaningless. Please review the codex with examples – http://codex.wordpress.org/Function_Reference/switch_to_blog A quick fix is putting restore_current_blog() within the foreach loop. What happens if you do not use … Read more
How do I get post attachments in menu_order in WordPress?
Is it really necessary to echo so much. If you make proper use of opening and closing php tags you can eliminate using echo. And why are you echoing get_the_title() when there is a build in feature for that. the_title() does exactly the same. You can use WP_Query to create a special loop to get … Read more
Any way for get_next_post() to use the actual post order instead of publish order?
You should use an object cache, it will definitely speed up the get_post_meta queries as they will be cached when doing the initial WP_Query (get_posts). I recommend testing with APC cache, using the APC Object Cache Backend : https://wordpress.org/plugins/apc/ Just drop the file in your wp-content folder and make sure you have APC extension available.
post_parent returns only the child pages of the page whose ID is given as the value. post_parent (int) – use page id to return only child pages. Set to 0 to return only top-level entries To get just a specific page, rather use page_id or pagename or post__in (in conjunction with post_type=page. I would suggest … Read more
I think you are having same issue as I was having earlier. In this question. So here is the fixed code. This should work. I replaced both of these functions with get_the_date and get_the_excerpt. For the detailed explanation why/why not this work, read @kaiser’s answer in same question. <?php $args = array( ‘posts_per_page’ => 5, … Read more
Conflict with get_posts and the_content