How do you add the category meta section above the entry title on single post details? I am sharing the simple step for this. I am using the free version of Astra theme. Disabling The Category Meta for Single Post At first we will disable the category meta option for single post. You can easily… Continue Reading
category
[Elementor Theme Builder]Displaying Category Description on Category Archive Page
As a SEO purpose it is a good idea. I am making the category archive page with Elementor theme builder. I shall display the category description below the category title. Here I am sharing my procedure. Adding The Short Description We shall add the short description to every category from Dashboard. Login to Dashboard Navigate… Continue Reading
Automatically Adds Sub Categories as sub menu under Parent Category menu item
Assume you create Programming posts category and add it into your site menu bar. Later you are adding some sub categories like PHP, CSS, HTML, JQuery etc under Programming category. You do not need to add them manually from Menu page(Appearance -> Menus). These sub categories and any future sub category of Programming category will… Continue Reading
Showing limited amount of categories on post meta
Original Message: I am trying to find a way to limit the amount of categories the Filed Under: Genesis shortcode outputs. Is there a way to do this? For example if a post belongs to 10 other categories it current displays every category, is there a way to limit it to only list x amount… Continue Reading
Showing full content on category page
Drop the following code in your functions.php file
1 2 3 4 5 6 7 8 |
add_action( 'genesis_entry_content', 'show_full_content', 1 ); function show_full_content() { if( ! is_category() ) //* returning early if it is not a category page return; add_filter( 'genesis_pre_get_option_content_archive', '__return_false' ); //* disabling the excerpt add_filter( 'genesis_pre_get_option_content_archive_limit', '__return_false' ); //* disabling the content limit option } |
if you are targeting the specific category page then use the following snippet:
1 2 3 4 5 6 7 8 |
add_action( 'genesis_entry_content', 'show_full_content', 1 ); function show_full_content() { if( ! is_category( 153 ) ) //* 153 is the category ID. return; add_filter( 'genesis_pre_get_option_content_archive', '__return_false' ); add_filter( 'genesis_pre_get_option_content_archive_limit', '__return_false' ); } |
153 is my “Plugins” category ID. So code is only executing when a user is visiting my “Plugins” category archive page. Checkout this link for more details about WordPress’s is_category() function.
Displaying taxonomy description when nothing is entered in intro text box
Category, tags and CPT’s taxonomy archive pages are only showing the intro text. Following code is showing the default WordPress taxonomy description when you are not using the intro text. If you have both (Description and intro text) then intro text will display. Checkout this gists.
Making Category Archive Page in Gallery Format
Step 1: Add this following code in your functions.php file : Step 2: Create a new js file “hover.js” and put in “your-child-theme-folder/js” folder. Now add this scripts into this file:
1 2 3 4 5 6 7 |
jQuery(document).ready(function($){ $(".col-3").hover(function(){ $(this).find('.entry-header').fadeIn(); },function(){ $(this).find('.entry-header').fadeOut(); }); }); |
Step 3: Loading this new JS file on your site using wp_enqueue_scripts function. Add the following php code in your functions.php file. This… Continue Reading
Adding categories and tags to pages
In this article I am showing how to add the category and tags to pages. First registering the category and tags taxonomy to “page” type by init and register_taxonomy_for_object_type functions. After adding this code “Categories” and “Tags” meta box will appear on Page Add/Edit Screen at Dashboard.
1 2 3 4 5 6 7 8 9 10 |
/** Enabling Categories and Tags Taxonomy for pages at Add/Edit Screen * * @since 1.0 * */ add_action('init', 'gd_register_category_tags_taxonomy_for_page'); function gd_register_category_tags_taxonomy_for_page() { register_taxonomy_for_object_type('post_tag', 'page'); register_taxonomy_for_object_type('category', 'page'); } |
Adding opening and closing footer markup. genesis_page_entry_footer_markup_open… Continue Reading