Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #308597

    I know that I previously saw a title at the top of the archive pages for post categories — probably author too. But I can’t find the category archive title on those pages anymore nor can I find a setting that turns this on or off:

    1)) I want to have the title of the archive appear at the top of the post listeng for archives

    2)) I would like to change the wording to say something like this:

    Posted in: «category name»

    Here’s a sample category archive page:
    Yet I cannot find out where or how to do this.



    • This topic was modified 9 years, 6 months ago by MacMyDays.

    Hey MacMyDays!

    Please open up enfold/archive.php and replace:

     <div class="category-term-description">
    <?php echo term_description(); ?>


    <h1 class="category_archive_title">
    single_cat_title( 'Posted in: ', true );
    single_month_title( ' ', true );
     <div class="category-term-description">
    <?php echo term_description(); ?>



    Is there a way to use this same code for a ‘by year’ function? I tried single_year_title… but that didn’t work. I didn’t think it would be that easy but thought I’d give it a shot.



    There is no single_year_title function, you could try stripping the month from single_month_title:

    preg_replace("/[^0-9,.]/", "", single_month_title( ' ', true ));



    Re: Changing the Page Title Text on Archive Pages.
    1. If using a child theme, do I put a complete copy of archive.php in child theme to make changes?
    2. Could you tell me the code I need if I want to substitute just the name of the category, for example “Event Video” instead of “Archive for category: Event Video”



    1.) Yes, you can copy the archive.php file to the child theme folder.

    2.) Add this on functions.php to change the category archive title:

    add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
    function avf_change_which_archive($output)
    		$output = __('','avia_framework').' '.single_cat_title('',false);
    	return $output;



    To clarify my question.
    I was thinking that the change was to be made in the archive.php – thus my question about putting a copy in the child theme.
    Since you said to put the code in functions.php (in my child theme, I assume), is there a reason to put the archive.php in my child theme? Or should I just put the code in the child functions.php and call it a day?



    That depends on the change you want to do, if you the code Ismael suggested does what you need then it’s not necessary.



    sorry wrong page

    • This reply was modified 3 years, 10 months ago by studiono.

    Thank you, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)

    Best regards,

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Archive Pages Title(s)’ is closed to new replies.