Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #927492

    Dear Enfold team,

    I set up a literature list on my blog using a custom post type that has a custom taxonomy. I hid the features images and post meta via CSS – this is what a category page looks like now:

    https://datenschmutz.net/litcat/twitter/

    Is it possible to insert the title and description of the category on top of the category listing? (But not for all categories in general, only for this one custom taxonomy). The description gets displayed, but not the category title.

    I searched the support forum, but I only found threads about woocommerce categories.

    Thanks for your help,
    greetings, Ritchie

    • This topic was modified 6 years, 8 months ago by datadirt.
    #927957

    Hey datadirt,

    Thank you for using Enfold.

    Please use this filter in the functions.php file.

    add_filter('avf_which_archive_output','avf_which_archive_output_mod_litcat');
    function avf_which_archive_output_mod_litcat(){
    	if (is_tax('litcat'))
    	{
    		$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    		$output = __('Archive for:','avia_framework')." ".$term->name;
    	}
    return $output;
    }

    Best regards,
    Ismael

    #928112

    Hi Ismael,

    thanks a lot! I added the filter to my functions php, but the titles do not show up – do I have to change something in the archive.php file as well?

    greetings,
    Ritchie

    #928739

    PS @Ismael – is there a way to sort the output of the litcat custom taxonomy alphabetically by title?

    #928878

    Hi,

    Please replace the filter with this code.

    add_filter('avf_which_archive_output','avf_which_archive_output_mod_litcat');
    function avf_which_archive_output_mod_litcat(){
    	if(is_tax()) {
    		$output = __('Archive for:','avia_framework')." ".single_term_title( '', false );
    	}
    
    	return $output;
    }

    For the post order, try to use the pre_get_posts function.

    // https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts

    Best regards,
    Ismael

    #1025907

    Hi @Ismael,

    sorry for going back to this, but I can’t figure it out – been through all the threads, but I just can’t figure out how to display the titles.
    The above snippet doesn’t seem to be working… any ideas?

    greetings, Ritchie

    #1026324

    Hi,

    It’s been a while. I hope you’re doing good.
    Regarding the issue, you have to enable the theme’s Header Title and Breadcrumbs from the Enfold > Header panel.
    The code above filters the output of that function or settings.

    Best regards,
    Ismael

    #1026357

    Hi Ismael,

    thanks for asking – yes, I’m quite fine. And totally amazed by the 4.4 / 4.5 updates.

    I activated the titles – works fine, only problem is though that I only want to use these titles for my cat/archive/tax pages. (as all the exisiting pages / blogpostings do have “manual” titles). Is there any way to activate the titles/breadcrumbs but then NOT to display them on postings/pages?

    greetings,
    Ritchie

    #1026685

    Hi,

    Yes, that’s possible. Use this filter:

    add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1);
    function avf_header_setting_filter_mod($header_settings) {
    	if ( is_tax() || is_archive() ) {	
    		$header_settings['header_title_bar'] = "title_bar_breadcrumb";
        }
    
    	return $header_settings;
    }

    Disable the title and breadcrumbs from the theme options.

    Best regards,
    Ismael

    #1026726

    Hi Ismael,

    thank you so much – this is absolutely brilliant!!

    have a great weekend,
    Ritchie

    #1026835

    Hi,

    Awesome! We’ll close the thread now. Have a nice day. :)

    Best regards,
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Category Title & Description on custom taxonomy category pages’ is closed to new replies.