Archived topic
Text on Custom Category Pages displaying on all Pages (Pagination)
24 replies · Started by Mark on August 13, 2021
The code that Elvin provided here:
That is CSS. It cannot be added in the functions.php.
It should go in your Child Themes styles.css or you can add it to the Customizer > Additional CSS.
Hi David,
Ok, my mistake. I have added in style.css
However, I don't believe it's the correct code to get the job done (there is no change in display).
Current display:
------------------
All the Elements display on page 1. This is good.
However, there are no elements displayed on page 2 onwards.
Desired display:
----------------
I'd still like to display the Custom Category Header and Breadcrumbs (from page 1) on pages 2 onwards (basically not showing the text that is on page 1) - is this possible?
Ah I see the issue here.
The issue is, you're trying to display the Header and the breadcrumbs only but it's completely gone on page 2 onwards because of the generate_element_display filter.
If I may suggest, you can remove the code with generate_element_display and just keep the CSS I've provided.
This way, the Header and the breadcrumb that is added within the Block Element still displays on all pagination pages of the category but hides the description on pages 2 onwards w/ CSS (the one I've provided).
We have a winner!
I just had to move the Additional CSS code from the header and put it on the text code. That did the job :)
Thanks for your help!
Closing thread
Nice one. Glad you got it sorted. No problem. :D
Hi there,
Thought it was easier to open this thread up again as it has background on what I want to do. Using Elements to add breadcrumbs, title and text to Category pages, but not having the text on pages 2 onwards for each Category, and not displaying the Category title on any Category page.
I achieved this on the first site thanks to your help, but it didn't work when adding to Customizer > Additional CSS. I had to add two separate pieces of code, one to style.css and the other to functions.css
On the second site I don't seem to have the Theme File Editor option under "Appearance" in the WP dashboard. How do I add the code to style.css and functions.css so that I can achieve the same objective as above?
Thanks
Hi Mark,
Are you using a security plugin?
Searching, I found that this could be a security setting issue either from a plugin or from your hosting: https://stackoverflow.com/questions/38426864/wordpress-theme-editor-is-missing
You can try #1 here to test and make sure no plugin is causing this: https://docs.generatepress.com/article/debugging-tips/
Alternatively, for PHP code, you may use a plugin called Code Snippets: https://docs.generatepress.com/article/adding-php/#code-snippets
For CSS code, you may add them in Appearance > Customize > Additional CSS.
Hope this helps!
That worked, thanks
You’re welcome Mark!