- This topic has 11 replies, 4 voices, and was last updated 3 years ago by
David.
-
AuthorPosts
-
March 16, 2023 at 3:08 pm #2570420
Geoffrey A.
Hi
I created a post and added it to the main menu. When I click on the menu, I see the title, and instead of the information on that page, I see the information of a page under that category.
I mean, the category and the post have the same URL. I want the menu to link to the post, which is well-designed, and not to the category.
Could you help me?
March 16, 2023 at 5:21 pm #2570478Leo
StaffCustomer SupportHi there,
Hmm I’m not seeing an obvious issue here.
The
/en/online-marketingpage you linked is a category archive for category online-marketing. A category archive is meant to display posts in that category.Here is an example from out site library where all the menu items are linked to category archives:
https://gpsites.co/read/Am I missing something here?
Let me know 🙂
March 17, 2023 at 3:12 am #2570820Geoffrey A.
Hi Leo, thanks for answering.
I created a category with the same name and address, but also a post with the same name and address. That way, people go to my post and not my category when clicking there. Ddo you mean that the menu is charging the category?
March 17, 2023 at 5:03 am #2570946David
StaffCustomer SupportHi there,
the WordPress template hierarchy will select an archive page over a single post, so you can’t have a post with the same name as a taxonomy term.
If you want to create static pages to replace the category pages there are a couple of ways to do it.
Question is – will all your category terms have a static post in place of their archives ?
March 17, 2023 at 11:15 am #2571475Geoffrey A.
For the moment no, but that is the plan! What suggestions do you have… this suspense is killing me! 🙂
March 17, 2023 at 1:44 pm #2571586Ying
StaffCustomer SupportHi Geoffrey,
I would recommend using the default category archive, you can use block element – loop template to customize the archive pages.
But if you want to stick with your plan, try this method:
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/March 17, 2023 at 6:48 pm #2571739Geoffrey A.
Hi Ying,
How can I use the block-element – loop template? When editing a category, none of the Generate Press options are active.
About the second option, is it required to create pages, does it work with posts? Because when creating the URL in pages, WordPress do not let me add the complete URL, for instance, I wanted to create a post for this category:
https://howtotakeoff.com/en/services/web-content/
I want to create posts because I will use Querry loops to connect a lot of information from other posts.
March 17, 2023 at 7:08 pm #2571746Ying
StaffCustomer SupportWhen editing a category, none of the Generate Press options are active.
Archive pages are index pages, you can not directly edit them.
The block element – loop template allows you to replace the archive loop entirely.
The steps are shown below:
1. Create a block element – loop template at appearance > elements.
2. Add a query loop block(GenerateBlocks plugin), you can toggle the
inherit loop from templateoption, so it shows all the default posts that are supposed to be shown on the archive page.3. The query loop block allows you to design the posts using blocks, it has some pre-built template for a quick start.
I wanted to create a post for this category:
Do you mean you want to create a static page?
March 18, 2023 at 1:26 am #2571884Geoffrey A.
Hi Ying, sorry, but I do not understand completely. I am not as expert as you may think.
How do I use the default category archive?
I am sorry, I do not understand.
If you visit the post I provided as an example, my idea is to provide some content and also create a query loop for each of these pages. I understand a block element is created to be added to a post or a page, but I cannot add paragraphs and titles and subtitles. Am I wrong?March 18, 2023 at 5:42 am #2572053David
StaffCustomer SupportHi there,
one method would require you to create a separate Block Element for each Category term.
That Block Element you would create as if it were the static page you’re currently trying to use.1. Create a block element in Appearance > Elements and set the type to Loop Template:
https://docs.generatepress.com/article/block-element-loop-template/
2. In the Block Element Display Rules set its Location to
Category Archiveand choose the specific term it will apply to.3. Now in the editor you can add whatever content you want it to display.
Repeat this for each term you want.
This will mean that the Category pages is still being selected, so any post meta or other links to that term will work correctly, but you can build it like it were a static page.
March 18, 2023 at 7:11 am #2572145Geoffrey A.
I worked. You are a genius. Thank you, so much.
March 18, 2023 at 10:09 am #2572408David
StaffCustomer SupportGlad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.