some posts being displayed as pages
some posts being displayed as pages
some posts being displayed as pages
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
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
I would recommend installing an easy to use custom post type plugin like Types. From there, you can create a custom post type called Guests. After that, I would to create some custom fields for these guests, such as a name, a multi-line field for biography, etc… The only variable I’m not 100% sure about … Read more
Custom Post Type permalink not working on new posts
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
OK here’s an attempt, however I don’t know the exact structure of your categories taxonomy so it may need some slight tweaking. I’ve updated the HTML of your form so it uses the values selected by the user, then there’s a block of PHP code which runs a custom WP_Query to display the relevant posts … Read more
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.
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
Post restoration