• Hi,

    I’d like to add a static text to my category pages. Preferrably with links.
    Does someone know how? Please tell it in easy steps, I’m just a beginner ??

    Cheers,
    Tijs

Viewing 13 replies - 1 through 13 (of 13 total)
  • where exactly?
    same text to all category pages?

    then edit category.php of your theme;
    if that does not exist make a copy of archive.php (or index.php) and save as category.php, then edit…

    https://codex.www.ads-software.com/Template_Hierarchy

    what theme are you working with?

    Thread Starter Tijs90

    (@tijs90)

    Alcymyth, thanks for your reply!

    I want the text at the top of the page and I want different text for diffferent pages.

    I’ using Genesis with a child theme.

    Website is https://www.musictherapydaily.com

    Thanks in advance,
    Tijs

    maybe consider to use conditional statements in caegory.php, based on is_category() to distinguish between the various categories; https://codex.www.ads-software.com/Function_Reference/is_category

    because genesis is a commercial theme, you might need to contact the theme’s developer for support;
    https://codex.www.ads-software.com/Forum_Welcome#Commercial_Products

    Tijs,

    Actually what might be a better solution is using the category description option in WordPress. This is built into most themes but if it isn’t built into Genesis we can always create a child theme to work around it.

    To find and edit your category text:

    1. Log into your WordPress admin panel.
    2. On the left hand side, hover over ‘Posts’ and click on ‘Categories.’
    3. Click on the category you would like to edit.
    4. Fill in the ‘Category Description’ and click ‘Update.’
    5. On the front end (public) side of your site, navigate to that category and try to identify if that text is showing up. If it isn’t let us know!
    Thread Starter Tijs90

    (@tijs90)

    Hey, thanks a lot for your help!

    @alchymyth: thanks, I didn’t know this wasn’t for commercial products, I will remember that ??

    @ivan: Thanks!
    Two questions:

    1. is it possible to use links in these descriptions?

    2. I can enter category text but it isn’t showing up anywhere. Also, I’m already using a free child theme over Genesis, don’t know if this makes the process any harder…

    Cheers,
    Tijs

    Tijs,

    1. It is possible to use links in the descriptions, you’ll just need to use code within the descriptions. Eg:

    <a href="https://example.com">Example!</a>

    2. If you already have a child theme, that’s great. Do you have any files in the child theme titled ‘category.php’?

    Thread Starter Tijs90

    (@tijs90)

    1. That’s great ??

    2.No,

    I have style.css, functions.php and 404.php

    Tijs,

    Alrighty well you already have the hard part (creating your child theme) out of the way, so that’s nice.

    1. First off, copy the ‘category.php’ from the parent theme, into the child theme’s folder.
    2. Look through the ‘category.php’ file that you have now moved into your child themes folder for the general area that you would like the category text to sit. It’s likely you’ll want it above the category content itself.
    3. Place the following code into category.php and upload it to your server!
    <?php
    /* If the category description isn't blank...show it! */
    if ( category_description() != "") { ?>
    <div class="categoryDescription"><?php echo category_description(); ?></div>
    <?php } ?>

    Then of course you can style it any which way you choose! Keep in mind that since you are now creating your own category.php, it will not receive any of the updates that Genesis or any other theme updater pushes out. That’s likely going to be fine, but it’s worth mentioning.

    Thread Starter Tijs90

    (@tijs90)

    It doesn’t have a category.php in the parent theme :$

    is this what we need:

    <h4><?php _e( ‘Categories:’, ‘genesis’ ); ?></h4>

      <?php wp_list_categories( ‘sort_column=name&title_li=’ ); ?>

    ?

    Tijs,

    Well then I’m afraid I likely can’t help you as I’m not overly familiar with Genesis. As @alchymyth stated previously, you’ll likely need to contact the developers of Genesis Themes directly as it’s a commercial theme.

    Sorry I wasn’t able to help out further!

    Thread Starter Tijs90

    (@tijs90)

    i found a guide to make page.php into category.php

    how can i copy the file to my child theme?

    Tijs,

    As I mentioned before, if it was just as simple as editing an existing category.php and adding the script I mentioned I would be comfortable helping. However since it’s a commercial theme I am hesitant to offer advice on modifying the theme more extensively simply because I don’t have much experience with the Genesis theme, and it’s developers will be much quicker and more helpful than I!

    Thread Starter Tijs90

    (@tijs90)

    I understand Ivan, thank you so much for taking the time to help! I will pass it over to the genesis forum.

    Cheers,
    Tijs

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Add static text to category page’ is closed to new replies.