Continuous listing from a custom field

First of all, please don’t use query_posts, but a new WP_Query. Outpu count based on page is just a matter of a simple arithmetic operation using current page number and posts per page number. global $wp_query; $paged = $wp_query->get(‘paged’) ? : 1; $posts_per_page = 10; // feel free to change this $args = array( ‘cat’ … Read more

Query posts from a specific category and selected tag

Since you’re working with the tag archive index page query, this really won’t be all that difficult. You simply need to filter the query parameters at pre_get_posts, using your criteria. For example: function wpse137627_pre_get_posts( $query ) { // If this is the tag archive index, // and is the main query if ( is_tag() && … Read more

Sorting Posts by Date – get_blogs_of_user_id()

You can build an array of all post items, and then sort them by date at the end of your querying: $blogs = get_blogs_of_user( get_current_user_id() ); if ( $blogs ) { $items = array(); foreach ( $blogs as $blog ) { switch_to_blog( $blog->userblog_id ); $posts = get_posts( ‘posts_per_page=2’ ); foreach ( $posts as $post ) … Read more

Create custom URL with different levels

On a very basic level, sub-pages inherit the URL segment of their parent page. A bit more complex, when creating custom taxonomies and custom post types you can define their slug for the WP rewrite engine. The documentation: http://codex.wordpress.org/Taxonomies#Custom_Taxonomies Neither is exactly what you’re looking for… Writing to .htaccess wouldn’t be that hard.

Why does WP_Query show only the same post even with different categories and endwhile?

If you want your posts based on different categories you should use category_name or cat as category id. For example; <?php $test = new WP_Query(‘cat=1&showposts=1’); // where 1 is the id of your cat ?> Or <?php $test = new WP_Query(‘category_name=errands&showposts=1’); ?> Also, you need to call wp_reset_postdata(); after each WP_Query. I hope this helps … Read more