How to create 450 categories in wp

You can try using BulkPress. It allows you to create hundreds of categories very easily. Follow these steps: Install and activate the plugin. In the left side bar, hover your cursor on Bulkpress. Then click on Terms. A new page will appear. In Taxonomy field, choose Category. Insert your Categories in the Terms field. Choose … Read more

Alphabetically ordered category list

Found the solution. Simply add $args = array( ‘parent’ => ‘0’, ); at the top, and change $cats = get_terms(‘category’); to $cats = get_terms(‘category’, $args); There are more values, see https://codex.wordpress.org/Function_Reference/get_terms

Display all posts with same title

Lets use the build in features WordPress has to offer. It is almost always not adviced to use custom SQL whenever WordPress offers native functions to perform the specific duty. To query our posts, we will make use of WP_Query. The only problem is, WP_Query does not support the feature where we look for posts … Read more

Most recent post from every category/taxonomy but sorted by date

In your code – Find $cat_args = array( ‘type’ => ‘post’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘taxonomy’ => ‘tax_name’); $categories = get_categories( $cat_args ); Repalce $cat_args = array( ‘type’ => ‘post’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘taxonomy’ => ‘tax_name’); $categories = get_categories( $cat_args );

Mass/Bulk assign categories to posts

First, you would need to parse your text file. Using fopen and fgets you can read a file line-by-line. For every line, you separate the comma-separated list of IDs by using explode. After that, it’s a case of simply calling wp_set_post_categories where the post ID is the first element of the list of IDs, and … Read more

Return array of categories to php function

this should do it: $categories = get_categories(); foreach( $categories as $category ) { echo ‘<input type=”checkbox” name=” . $category->slug . “” value=”‘ . $category->term_id . ‘” /> ‘ . $category->name . ‘<br />’ . “\n”; } and you can change/order the list by feeding arguments to get_categories(): http://codex.wordpress.org/Function_Reference/get_categories

Remove “Category Archives: title” at the top of a category page [duplicate]

The text is coming from Twenty Eleven theme’s category.php file. There are two ways to remove it: A) Removing it using a Text/CODE Editor on the File System/FTP: This is the recommended method Go to Your WordPress Installation Folder. Then wp-content/themes/twentyeleven folder. Then open the category.php file in a Text or CODE Editor. On line … Read more

How to make all posts in a category sticky?

You rather need a save_post hook. Check following code it marks the post sticky for the specified if it is not already. add_action( ‘save_post’, ‘mark_post_sticky’ ); function mark_post_sticky( $post_id ) { if ( !wp_is_post_revision( $post_id ) && !isset($_POST[‘sticky’]) && in_category(‘bestcategoryever’,$post_id) ) { $_POST[‘sticky’] = ‘sticky’; } }