Sorting posts by season

Probably the most “WordPress-y” approach to such a problem is to store the date of your ‘event’ custom post-type in the post’s metadata. Enabling users to set meta-data on a post is usually accomplished by using the ‘register_meta_box_cb’ argument to the register_post_type() function to add an extra “meta box” interface to the pages for creating … Read more

How to change number of items on add new pluggins page from backend?

You can filter the parameters for this view per install_plugins_table_api_args_search. See wp-admin/includes/class-wp-plugin-install-list-table.php for the details. You get an array as argument that looks like this: Array ( [page] => 1 [per_page] => 30 [fields] => Array ( [last_updated] => 1 [icons] => 1 [active_installs] => 1 ) [locale] => en_US [installed_plugins] => Array ( [0] … Read more

Exclude category from Tag Template

Have you tried using a normal loop in your tag template like this <?php while ( have_posts() ) : the_post() ?> //add content code or template <?php endwhile; ?> And then using the pre_get_posts filter like this function exclude_category( $query ) { if ( $query->is_tag() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-433’ ); } } … Read more

Categories vs. Page Site Organization

You could create a customised ‘landing page’ using a template file? Creating category-internal.php with custom layout would display content at the /category/internal/ url. Here is some more info: https://codex.wordpress.org/Category_Templates http://www.wpbeginner.com/wp-themes/how-to-create-category-templates-in-wordpress/

category hierarchy level as a body class – parent cat =1, child cat=2, grandchild=3

You can achieve this by using the following custom code. You can use the code by adding it in the functions.php file of child theme or in the custom plugin file. add_filter( ‘body_class’, ‘custom_cat_archiev_class’ ); function custom_cat_archiev_class( $classes ) { if ( is_category() ) { $cat = get_queried_object(); $ancestors = get_ancestors( $cat->term_id, ‘category’, ‘taxonomy’ ); … Read more

How to link 2 categories (Sync)

Place this in your theme functions: function mysite_clone_post($post_id, $post, $update) { if(!$update && in_category(‘home cat’, $post)) { //not handled updates and will only run if in this category $post_fields = array( ‘post_author’, ‘post_date’, ‘post_date_gmt’, ‘post_content’, ‘post_content_filtered’, ‘post_title’, ‘post_excerpt’, ‘post_status’, ‘post_type’, ‘comment_status’, ‘ping_status’, ‘post_password’, ‘post_name’, ‘to_ping’, ‘pinged’, ‘post_modified’, ‘post_modified_gmt’, ‘post_parent’, ‘menu_order’, ‘post_mime_type’, ‘guid’, ‘tax_input’, ‘meta_input’); $postarr … Read more