• Resolved catwingz

    (@catwingz)


    I have created a custom category page for ‘News’ and would like to replace the current heading of

    Category Archives: News

    with a regular heading of

    In the News

    . Is this possible? and how? Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • just for the ‘news’ category page?

    edit this line in the custom category template for ‘news’:

    <h1 class="archive-title"><?php printf( esc_html__( 'Category Archives: %s', 'quark' ), '<span class="cat-archive">' . single_cat_title( '', false ) . '</span>' ); ?></h1>

    change it for example to:

    <h1 class="archive-title"><?php printf( esc_html__( 'In the %s', 'quark' ), '<span class="cat-archive">' . single_cat_title( '', false ) . '</span>' ); ?></h1>

    hopefully, you are using a child theme … https://codex.wordpress.org/Child_Themes

    Thread Starter catwingz

    (@catwingz)

    I made some progress with it and have successfully changed the words. The next issue though is to have the text display as an h1 or h2. In the code it looks like it is supposed to display as an h1, but instead it is tiny smallcaps. Any assistance would be appreciated. Thank you

    Thread Starter catwingz

    (@catwingz)

    To be clear, even though it is in an h1 tag, it is not styled the way all other headings on the site are styled. I tried using

    h1 .archive-title.cat-archive {
    font-family: Lora; important!
    font-size: 1.3em;
    }

    in both Google fonts and the CSS supplied by Jetpack, but neither had an effect. It is accepting the color all headings have though…

    Thread Starter catwingz

    (@catwingz)

    @michael, I just saw your post. Will the code you suggest do anything to change the styling? I haven’t implemented it yet, but it looks like it only addresses the wording issue which I have already solved.
    Thank you!

    the suggested code will only address the wording, not the styling.

    .archive-title is a CSS class of the h1 element, while .cat-archive is a CSS class of the seperate span element;

    also, the !important, if necessary at all, has to be before the semicolon;

    therefore, try the corrected CSS (untested):

    h1.archive-title .cat-archive {
    font-family: Lora!important;
    font-size: 1.3em;
    }

    for any help with the styling, please post a link to the web page with the problem.

    Thread Starter catwingz

    (@catwingz)

    Thank you @michael! Problem solved!
    The code ended up like this:

    h1.archive-title .cat-archive {
      font-family: Lora!important;
      text-transform: none;
      font-size: 1.9em;
      font-weight: normal;
    }

    I neglected to say this at the beginning of the thread, but this site is not yet visible to the public because it is in WordPress’ stealth mode for development. I have a couple of other little tweaks to text which will be accompanied by the url if I haven’t solved them by the time it goes public.

    Too bad WordPress doesn’t offer an option to allow previews without requiring a login!
    Thanks again for the solution!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘replace heading on custom category page’ is closed to new replies.