Assign specific ads to specific categories/posts

You have attempted to paste your PHP into a text widget. and the tags have been transformed. <div class=”textwidget”> <!–?php if (is_category(‘5′)) { ?–> You can’t execute PHP from a text widget by default, and I would not recommend trying to do so (it should be possible). Instead, it is trivial to build your own … Read more

Getting posts from multiple users?

First of all, I suggest don’t use query_posts. (No one is really a WPSE user if had no read this answer). So you can use WP_Query with author__in parameter in combination with array_keys PHP function. $paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; $query = new WP_Query( array( ‘author__in’ => array_keys( $following … Read more

Latest Posts not in the right order

I actually got this issue fixed with a very simple feature in wordpress my theme developer had never mentioned, after hours of misery and awesome help from @Pieter . I was doing a lot of research and found out some themes required I use the <!–more–> tag built in wordpress to show only a part … Read more

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.