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

    I would like to be able to change the text of a category Archive (or any other) page header to custom text. Can this be done? If not, alternately how can I remove this text entirely? Can these changes be done post by post or only globally?

    Thanks!

    #55628

    Hey,

    you can change the archive text globally in archive.php. Near the top you’ll see the text strings “Archive for”… – you can replace it with any custom text.

    #55629

    How do I replace the text at the top of a particular navigation item I have named”random” for example? This menu nav item is calling for a few different categories to display..is there a way to change that – or at least make it disappear? I need to be able to customize an archive page so it doesnt say “Archive for ______” at the top. Thanks!

    #55630

    In this case just delete following line in archive.php – this will remove the archive heading:

    if($output != "") $output = '<h2 class="superheading">'.$output.'</h2>';

    #55631

    Thanks! I appreciate you!

    #55632

    wait, it still leaves a small text line that says “archive for ______”. But it removed the big H1 text

    #55633

    Hey dude..it still leaves a small text line that says “archive for ______”. But it removed the big H1 text. Is there a solution to remove all text?

    #55634

    Hi,

    in your archive.php you’ll see

    $output = __('Archive for ','habitat').single_cat_title('',false);
    } elseif (is_day()) {
    $output = __('Archive for ','habitat').get_the_time('F jS, Y');
    } elseif (is_month()){
    $output = __('Archive for ','habitat').get_the_time('F, Y');
    } elseif (is_year()) {
    $output = __('Archive for ','habitat').get_the_time('Y');
    } elseif (is_search()) {

    You can remove all occurrences of “Archive for”, like this:

    $output = __(' ','habitat').single_cat_title('',false);
    } elseif (is_day()) {
    $output = __(' ','habitat').get_the_time('F jS, Y');
    } elseif (is_month()){
    $output = __(' ','habitat').get_the_time('F, Y');
    } elseif (is_year()) {

    This should work without the solution Dude provided.

    If the above isn’t what you need you can undo it. Then, find the following in the same file:

    if($output != "") $output = '<h2 class="superheading">'.$output.'</h2>';

    Replace it by

    if($output != "") $output = '';

    #55635

    Thanks Chris! The first option removed the “Archive For” and the second option removed everything entirely.

    #55636

    Glad that I could help :)

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Archive page header’ is closed to new replies.