Archived topic
How to put body text on Index and category pages
3 replies · Started by Anders on November 13, 2019
Hello Support, I bought the generate press pro modules and I am currently using Mellow as a theme. I have been having quite a lot of problems with the implementation, especially with the design (it does probably have to do more with me than the theme. However, I would like some guidance, my main questions are:
1. How do I put body text on my category pages? I would like to have some tests on the pages to describe what they are about but they are not as easy to edit as the regular pages are.
2. How do I add body text on the index page? same problem here, I would like to have body text as well as my latest post showing. I tried to do this by enable the static page and then add the code for showing the latest posts but I can´t seem to remove the annoying widget (search field). It says that no widgets are enabled but still the search field is showing.
3. Last question, I tried to change the header hero for the category and regular pages, one of them was successful, but doing the same thing on my other pages gave me completely different results. Shouldn´t it be the same if all the settings are the same and the only change is made in the "display rules"?
I really appreciate all the help I can get with this, so far I like the theme a lot, just that I feel limited in the changes I seem to make.
Kind regards, Anders
Hi there,
1 & 2: This depends on where you are trying to add the text.
If it's between the header and content, then the header element should do:
https://docs.generatepress.com/article/header-element-overview/
If it's somewhere else then Hooks Elements should help:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/hooks-visual-guide/
3. Can you link or guide me to the two header elements you are referring to so I can compare the differences?
Let me know :)
Sorry for the late reply. I wanted to go for the second option. Putting a hook on the "category page" Before the footer.
add_action( 'generate_before_footer','ab_insert_into_wp_head' );
function ab_insert_into_wp_head() { ?>
TESTING MY FIRST HOOK CONTENT - Don´t know why it won´t work
<?php }
I don´t know what I did wrong here. This is the page I want to put text on:
I am very grateful for your help
Kind regards, Anders
Hi there,
Where are you adding that code?
That specific code should be added using one of these methods: https://docs.generatepress.com/article/adding-php/
If you're using a Hook Element, you only need the content part: TESTING MY FIRST HOOK CONTENT – Don´t know why it won´t work