Site logo

[Resolved] I have an error when added a post to the main menu

Home Forums Support [Resolved] I have an error when added a post to the main menu

Home Forums Support I have an error when added a post to the main menu

  • This topic has 11 replies, 4 voices, and was last updated 3 years ago by David.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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?

    #2570478
    Leo
    Staff
    Customer Support

    Hi there,

    Hmm I’m not seeing an obvious issue here.

    The /en/online-marketing page 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 🙂

    #2570820
    Geoffrey 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?

    #2570946
    David
    Staff
    Customer Support

    Hi 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 ?

    #2571475
    Geoffrey A.

    For the moment no, but that is the plan! What suggestions do you have… this suspense is killing me! 🙂

    #2571586
    Ying
    Staff
    Customer Support

    Hi 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/

    #2571739
    Geoffrey 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.

    #2571746
    Ying
    Staff
    Customer Support

    When 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 template option, 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?

    #2571884
    Geoffrey 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?

    #2572053
    David
    Staff
    Customer Support

    Hi 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 Archive and 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.

    #2572145
    Geoffrey A.

    I worked. You are a genius. Thank you, so much.

    #2572408
    David
    Staff
    Customer Support

    Glad to be of help!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.