Community Forums › Forums › General Genesis Framework Discussions › How do you add text to the bottom of category and tag archive pages (metro pro)
Tagged: archive, category page, Metro Pro, tags page
- This topic has 7 replies, 2 voices, and was last updated 11 months, 3 weeks ago by Brad Dalton.
April 2, 2022 at 12:49 pm #504933
I am trying to add text to the bottom of my category and tag pages after the posts excerpts. So i have 20 posts per archive page displayed, at the end of these 20 post excerpts, i would like to have some text as an outro. So basically the posts in an archive are sandwiched between some intro text (which i can do) and some outro text (which i can not do)
Very sorry if this has been covered but after 2 days of trying and failing to use advanced custom fields plugin and genesis hooks to hook in to the right part of the template i figured i must be missing an easy solution.
I am trying to simply add a unique block of text at the bottom of my category and tag pages after the post excerpts. Similar to how the intro text block can display text before the posts loop on individual category and tag archive pages, i want to have "outro" text as well.
Can anyone help me achieve this?
thanks in advancehttps://everycasinobonus.com/tag/norway-casino/April 2, 2022 at 4:28 pm #504934April 3, 2022 at 9:55 am #504944
Thank you for taking the time to try and help me out 🙂
I read your articles and guides, but with my minimal coding knowledge, i was not able to make this work for me. But i do understand from reading your guides that i need to hook into the genesis_before_footer hook, which i can do with simple hooks.
I am able to create a custom field with advanced custom fields plugin - https://www.advancedcustomfields.com/ - to give me a wysiwyg editor on both tag editor and category editor pages within wordpress. I add my content to this editor then add the code from the advanced custom fields documentation page - https://www.advancedcustomfields.com/resources/code-examples/ -
<p><?php the_field('field_name'); ?></p> (replacing 'field_name' with my category or tag name)
also this code which a friend of mine uses and works in his (non genesis)theme in his archive.php file
<?php echo get_field('extra', 'category_' . $cat);?>
and also i tried this code
echo '<p>' . get_field('field_name') . '</p>';
and checked the box to execute php on this hook, but nothing showed up. Is there an action or filter i need to add to my functions to show this or let this code execute in that hook?
Also, is there a way to add this code to a archives.php or category.php genesis file if this would work better?, it seems the genesis theme files are a minefield for someone with limited coding knowledge.
lastly, if all else fails, would you suggest paying a wordpress developer, perhaps someone on fiverr? i imagine this a fairly straight forward job for a wp developer?
what are your thoughts
thanks for continued help, i appreciate itApril 3, 2022 at 10:55 am #504945
You can use the code in a archive.php or tag.php and category.php template
In your child themes functions file with a conditional tag.
If you can't work out how to write the code, there might be a plugin in the WordPress repo which does the job.
April 3, 2022 at 11:28 am #504946
Hi, i did read this article this morning and it looked to be something that would work, but the problem i have is locating the category.php, tag.php and archive.php with this theme (metro pro)
I was able to find in the genesis parent theme (which they strongly advise to not edit) in genesis/lib/structure/archive.php but this does not look like a regular archive.php or category.php that my limited knowledge of these files remembers. It is full of calls to action and looks highly breakable to insert php code into.
usually with themes i use i can see the category and tag php files in the theme ediotr within wordpress and i could insert the code like this
(image of friends category.php (non genesis theme) using advanced custom fields code)
here is the category/ archiev .php from another theme i use (point theme)
this again would be where i add the code. but the problem i seem to have is locating this with the genesis parent theme and the metro pro theme.
Can you shed more light? please
thank youApril 3, 2022 at 9:28 pm #504948
You will need to create your own archive or category or tag template file(s) in your child theme. This requires coding knowledge.
April 4, 2022 at 2:15 am #504950
thanks for your help bradApril 4, 2022 at 3:03 am #504951
- You must be logged in to reply to this topic.