Sort Posts Alphabetically by Multiple Categories [duplicate]

Use the orderby and order parameters in the argument list. See the Orderby_Parameters section of WP_Query for details. $category_ids = $arr_records = $post_data = array(); $categories = get_categories( ‘child_of=4’ ); foreach( $categories as $category ) { $category_ids[] = $category->term_id; } $post_data = get_posts( array( ‘cat’ => $category_ids, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ) ); … Read more

How to create three columns from selected posts

You might not have expected this kind of solution but it is worth knowing that there is also a front end solution for this kind of problem. The css3 spec have a new feature called column-count, which will automatically render your text in multiple columns Here is a simple example from w3schools div { column-count:3; … Read more

About number of posts in selected category

WP_Query has the following properties you might find handy: $wp_query->current_post – Index of the post currently being displayed. $wp_query->found_posts – The total number of posts found matching the current query parameters

get next/previous post name

$prev = get_previous_post(); $next = get_next_post(); $prev_title = $prev ? get_the_title($prev) : ‘Current is First Post’; $next_title = $next ? get_the_title($next) : ‘Current is Last Post’; See get_previous_post and get_next_post on Codex for some details and additional params you can use.

Assign certain editors to certain posts

If you used author, instead of editor, then WP default functionality would be such that they could only see those posts they are listed as author on. Editor might be then used for something like a supervisor who doesn’t need other admin roles. This solution means you don’t have to modify anything and can use … Read more

Add Custom Post Type on the Fly or create an array

use $wp_insert_post function to create posts and to create sub posts of this use this function again and set post_parent = “name of post you created” see list of all arguments and usage of this function wp_insert_post

How to get all the terms of a post

Well to print each term you could loop through each object and echo the name and description foreach ($terms as $theterm) { echo $theterm->name . ” ” . $theterm->description; } Is this what you are looking for? [EDIT] Updated the answer