Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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: http://worldri.de/VK9p0s
    Yet I cannot find out where or how to do this.

    thanks,

    MmD

    • This topic was modified 10 years, 2 months ago by MacMyDays.
    #308835

    Hey MacMyDays!

    Please open up enfold/archive.php and replace:

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

    with:

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

    Regards,
    Peter

    #308976

    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.

    #309148

    Hi!

    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 ));
    

    Cheers!
    Josue

    #309596

    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”

    #309671

    Hi!

    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)
    {
    	if(is_category())
    	{
    		$output = __('','avia_framework').' '.single_cat_title('',false);
    	}
    
    	return $output;
    }

    Regards,
    Ismael

    #310081

    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?

    #310084

    Hey!

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

    Cheers!
    Josue

    #1198585

    sorry wrong page

    • This reply was modified 4 years, 7 months ago by studiono.
    #1198914

    Hi,
    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,
    Mike

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