Changing the Title for Category Pages ( Archive)

resolved (14 posts) (4 voices)

  1. Bodhichitta_Victoria
    Member

    I would like to remove the words CATEGORY ARCHIVE FOR as well as the quotes around the category name and I cannot find which file it is in to edit. Here is the sample page.

    http://meditatevancouverisland.org/category/events/daycourse_retreats/

    Thanks

    Posted 4 years ago #
  2. Elliott
    Support

    Hello Bodhichitta_Victoria,

    Open up /wp-content/themes/[your_theme]/lib/functions/theme.php and change line 1080 from this,

    $text = sprintf( __('Category Archive for: %1$s', MYSITE_TEXTDOMAIN ), '‘' . single_cat_title('',false) . '’');

    To this,

    $text = single_cat_title('', false);

    Posted 4 years ago #
  3. Bodhichitta_Victoria
    Member

    Well I was looking for an entry like that, but I don't see theme.php showing up in the Editor within the dashboard, which where I have done similar edits on other themes in the past..
    Are you saying edit the theme.php file with some other editor and then upload it to replace the current one with ftp? Or am I missing something?

    Posted 4 years ago #
  4. Bodhichitta_Victoria
    Member

    picture of dashboard editor ( part of preceding message)

    Attachments

    1. dashboard_editor_pic.JPG (99.6 KB, 0 downloads) 4 years old
    Posted 4 years ago #
  5. Elliott
    Support

    Yes, you'll need to edit it via FTP.

    Posted 4 years ago #
  6. Bodhichitta_Victoria
    Member

    I did.. here is a picture. And it still shows the words, even after refreshing.

    Attachments

    1. theme_php_change.JPG (101.2 KB, 0 downloads) 4 years old
    Posted 4 years ago #
  7. Elliott
    Support

    Try line 1264,

    $title = sprintf( __('Category Archive for: %1$s', MYSITE_TEXTDOMAIN ), '‘' . single_cat_title('',false) . '’');

    Posted 4 years ago #
  8. Bodhichitta_Victoria
    Member

    That does not seem to do it either. I found this line of code at 2000 something and it looks promising as it is a header, which what the issue is but I am not sure what to change it to and if those other changes are necessary.
    <h2><?php _e( 'Category Archives', MYSITE_TEXTDOMAIN ); ?></h2>

    Posted 4 years ago #
  9. Elliott
    Support

    That's for the sitemap. Since it's a page title it should be line 1264.

    Posted 4 years ago #
  10. Bodhichitta_Victoria
    Member

    Ok, but that is the only other place the words CATEGORY ARCHIVE exist in the whole file and yet, as per my previous message it is still being displayed on the page.

    Here is the link again
    http://meditatevancouverisland.org/category/events/daycourse_retreats/
    and I attach a screen shot of the code

    It must be someplace else then.

    Attachments

    1. theme_php_change_2.JPG (103.3 KB, 1 downloads) 4 years old
    Posted 4 years ago #
  11. Elliott
    Support

    Make sure that your editing the correct theme and that you refresh any caching plugins you might have installed.

    Posted 4 years ago #
  12. MC
    Member


    Posted 4 years ago #
  13. MC
    Member

    That worked for me.

    BUT the title of the archives page is still "ARCHIVES" (in big type) and underneath is "name of the category" in smaller type.

    Change:

    $title = sprintf( __('Category Archive for: %1$s', MYSITE_TEXTDOMAIN ), '‘' . single_cat_title('',false) . '’');

    to:

    $text = single_cat_title('', false);

    Successfully removes the "Category archive for" bit

    In order to change "Archives" to "category name",

    opened up lib/functions/theme.php and changed this (line 1075):

    $title = __( 'Archives', MYSITE_TEXTDOMAIN );

    to: $title = single_cat_title('', false);

    NOTE: I´m using the Dejavu theme - very good!
    The bits of code that needed changing appears on lines 1075, 1077 AND on line 1261
    The "Category archive for" text disappeared when I changed line 1077 (curiously not so if only edit line 1261)

    Under theme´s General settings, Intro Default Options are set to set to show "title only"

    Hope this helps.

    Posted 4 years ago #
  14. Thanks a lot for sharing this!

    -roch

    Posted 4 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme