- This topic has 23 replies, 3 voices, and was last updated 4 years, 3 months ago by David.
August 7, 2019 at 2:04 pm #978496Heather
I am trying to customize my category archive page, and I am able to create a hook that pulls in all the posts for a specific category, but I can only place it above or below the “main content”, which are the same posts just styled differently.
Is there an option to have that hook be the only content that appears on the page, and the original content is gone? I tried to also check off all of the boxes in Appearance > Customize > Layout > Blog that was available, but unfortunately the title of the posts are still visible, and there does not seem to be a way to get rid of it. If there is a way to get rid of these that would be great as well? (there is no actual category archive page that exists in pages that I can access to do it manually).August 7, 2019 at 3:26 pm #978542LeoStaffCustomer Support
I’m not quite sure if I fully understand.
Any chance you can link us to the site in question so I can see your current set up and issues?
You can edit the original topic and use the private URL field.
Let me know 🙂August 8, 2019 at 8:40 am #979153Heather
Unfortunately I can not link you to the page as it is on a dev server. I will try to explain with images.
I have a sidebar that lists all of the categories/tags that exist, so that when they are clicked it will take you to a page that shows all the blog posts that contain that tag. The existing category archive page is not the design I want, so I am creating a hook that is a custom version of the category archive page, and placing it “before_content” or “before_main_content”, and I would like to essentially remove or “hide” the existing content on the category archive pages with the new content I am making in the hook.
In Appearance > Customize > Layout > Blog, I have checked off all of these options for the archives so that no content or author information would show up..
But, even after all that, I am still left with all of the titles
I want to also find a way to remove all of these titles, so that only my new code/content/design shows up from my hook-
So those titles always exist above my new content/design, because I don’t know how to get rid of them. I tried to find a hook location that would overwrite it, but I can’t seem to find one as it is always before or after content –
Normally, for things like the blog archive page or something, there is an actual page you can go to delete things. I also tried to go into the posts with those titles and hide the title using the little eye icon beside the title when creating a new blog post, it still appears.
Can you tell me how to get rid of these titles so that I can only have my content/design show up on the page when a category is clicked on from the sidebar.August 8, 2019 at 12:02 pm #979306LeoStaffCustomer Support
Hmm I don’t think that’s the best way to modify the archive/category pages.
What if you just create static pages for them and list them out in the sidebar widget?
I can’t tell where the title is with screenshots unfortunately.
Any chance you can set up a staging site so we can provide better assistance?
Let me know 🙂August 8, 2019 at 1:53 pm #979381Heather
What do you mean static pages and list them out in the sidebar widget? It’s the main body of the content for those pages, not a sidebar. I have a right sidebar already.
And those titles are above all of my custom content. As for the hook I placed it after_content or something to test where it shows up.
I can create static pages, as I’ve done that for the blog post archive, but I don’t think there is a way to create one static page that will dynamically render the blog posts of a specific category once it’s clicked on from a sidebar or another link. Also, because of the way the elements are set up when you select the location for the display rules, there’s no way for the blog itself to know to direct people to that page when a category is selected, as that’s all pre-determined by wordpress.
Unfortunately no there’s no way to create a staging site for you.August 8, 2019 at 1:53 pm #979382Heather
If you have a better suggestion, please let me know.August 8, 2019 at 1:57 pm #979383DavidStaffCustomer Support
what is the difference between the Hooked content and the original archive content?
Are they both showing the same posts and its just a matter of a different style?
Let us know.August 9, 2019 at 7:00 am #979831Heather
The Hooked content and archive content are the same yes, so – for example, if I have a sidebar with 10 categories, and one of them being tacos, when I click on tacos it will take me to a category archive page that shows all the posts with the category of taco.
I have made custom php code to bring in that same content through a hook, because the styling I am doing I cannot add directly to elements/classes on the original, as there is not enough differentiation between them throughout the site – ie: there are many “inner-container”, “entry-content”, etc and I can’t style them differently from page to page. So, I needed to create this hook in order to bring in the content with custom classes so I can style it a specific way.
The issue is that on the archive page, say for “tacos”, when I have my hook displayed and all the archive content checked off from the Appearance > Customize > Layout > Blog (see photo from a few posts ago), the titles still remain (see photo from a few posts ago). I want to know if there is a way to get rid of these titles from showing up so that ONLY my hooked content appears, as I was able to get rid of everything else that is related to the posts. I am trying not to display:none a section.August 9, 2019 at 7:03 am #979835Heather
Note: the titles appear first, and then my hooked content because of where I am putting the hook, but they sometimes show up before the hooked content if I place it as before_content. See photo – custom hooked content appears below the pagination numbers, titles of the posts with same categories appear above in blue.
August 9, 2019 at 7:04 am #979839Heather
sorry wrong photo:August 9, 2019 at 7:50 am #979986DavidStaffCustomer Support
You can use the body-classes to target a specific page or archive.
So for your Taco category there would be a body class of
So you could style the various elements specifically for that page.
Let me know if i misunderstood.August 9, 2019 at 8:31 am #980020Heather
It may be possible, the issue with this is that it adds a lot more css code as I would have to do it for each category and be very explict with targeting – ie: .blog-taco .inside article or .blog-taco .inside-article .entry-summary p
Also, if a new category gets added, I would have to go and add all of this code with the .blog-whatever each time. Since this is for a company it needs to be dynamic to just update and pull in the information/styling regardless of what they do to a category/post/whatever. So I have to use the custom hook.August 9, 2019 at 8:33 am #980022DavidStaffCustomer Support
How many different style Category archives will there be?
And how do you determine which category gets which style?August 9, 2019 at 8:50 am #980039Heather
Well, there’s as many archives as there are categories – every category has it’s own archive, and every category archive page is going to look the same because it needs to be consistent. So if there are 10 different categories, each one is going to have it’s own archive page and they will all look the same.
So I have all the styling done for the archive pages, I just need those titles to disappear..August 9, 2019 at 8:51 am #980040Heather
ie: that hook currently has the display rule “Post Category Archive – All Categories” so that it is applied to everything
- You must be logged in to reply to this topic.