• tvejacques

    (@tvejacques)


    There is a weird problem. This happens only for about 20-30 pages of 135 pages.

    When following a link on a page (from Content block) it leads to the correct page. Example: annual events (accessed from https://tulbagh-valley-explorer.co.za/events-list/)

    When following the very same link from a mega menu (Events –> Annual events), it leads to a page that looses all style, while the Content block is empty.

    The permalinks are exactly the same. In this case:

    https://tulbagh-valley-explorer.co.za/annual-events/

    This problem does not occur on the site we built as proof-of-concept, which is the primary site on a mutisite setup. We exported the site, and imported it into the final public site (which still requires a lot of development).

    We wonder if some glitch did not happen during the import process.

    Or what else might it be?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator bcworkz

    (@bcworkz)

    One link is /category/annual-events/ and the other is just /annual-events/. It’s not clear what sort of query /annual-events/ is making. /category/annual-events/ is querying for posts with the annual-events term assigned and there apparently are none.

    It’s possible for themes and plugins to alter queries. One of these could be interfering with normal category queries. Use the Query Monitor plugin to see what the actual SQL query is for the category archive. The reason it’s failing should be evident, assuming posts exist that do have that term assigned.

    Thread Starter tvejacques

    (@tvejacques)

    bcworkz I appreciate your feedback (this post and the others you have assisted me with). You are good people.

    I am still trying to find the problem

    Moderator bcworkz

    (@bcworkz)

    On the /annual-events/ page (not the one from the nav menu), how do those events come to be there? Are they part of the page’s content? Or is there a secondary query (such as a query loop block) that gets annual events?

    If you open one of the annual events for editing, does it actually have the annual event category term assigned to it? It should. If it did, the nav menu item link should result in the event being listed.

    Are events a special post type or are they like common blog posts? If a special post type, then the nav menu item link likely needs to specifically request that post type. Normally a category query only retrieves blog posts in that category, not other post types. It’s also possible to modify which post types to query for through the “pre_get_posts” action hook.

    Thread Starter tvejacques

    (@tvejacques)

    Thanks bcworkz
    These are static Pages that will form the structural backbone for reference purpose.
    The dynamic pages will interact with those static pages.

    So presently there is no queries or scripts other than very basic page rendering.

    On the Dev and Test site, it works perfectly.
    Given the present delay, we might just re-import from the test site – it does indeed seem some gremlins slipped in during the export/import process.

    Thread Starter tvejacques

    (@tvejacques)

    Hi bcworkz
    Thanks for all your help thus far.
    I found the problem, but have no idea why it happens.
    It is the Menu.
    We tried a couple of menu plugins, and the culprit is JetMenu.
    When using their menu plugin, somehow the links go through some script (I think) as it calls up product page templates. That despite in their location settings that Pages was selected.
    Other menu plugins (e.g. Essential Blocks), using the exact same settings, link to the correct target pages.
    Problem thus solved, but I’d like to understand Why?

    Thanks again for your great support
    Keep well

    Moderator bcworkz

    (@bcworkz)

    So your intent was to have the menu item lead to the /annual-events/ page that displays correctly and not the annual events category archive which returns nothing found? I don’t know anything about JetMenu. Assuming its menu was defined manually, usually when you add menu items you select what sort of link you want, whether it’s a category archive, WP page, or post. It should then be a matter of picking the link from the pages list and not the category term list. At least when using the default WP menu editor, I’ve not seen the JetMenu UI.

    If JetMenu constructs menus automatically or semi-automatically, I can see how when it comes to “Annual Events” it confuses the category term link with the page link and chooses the wrong one. It likely just went with the first “Annual Events” item it found.

    This sort of ambiguity is why it’s not the best idea to have more than one item type utilize the same slug. Or if re-using the same slug is necessary, at least recognize this can happen and have the ability to correct any confusion. I would expect JetMenu to have some sort of mechanism for selecting what sort of item is being linked. You should be able to tell it you want a page’s link and not a term’s archive link. If how to do so is unclear, I recommend seeking further guidance through JetMenu’s dedicated support channel where its support staff are in the best position to advise.

    Thread Starter tvejacques

    (@tvejacques)

    You have been very kind and patient to assist us, bcworkz! Thanks so much.

    Given the various problems (still unsolved) we experience, it is probably best to start again. Something must have gone wrong during the export/import process from the Dev site (where the basic skeleton was developed) to the final site. Fortunately we are not far down the development path on the final site, building on top of the skeleton.

    Question (hopefully last on this topic):

    If we purge the slug table (to get rid of duplicate slugs), can we then add slugs to the pages – without breaking the system completely? This is after all not yet a working site.
    Fortunately we keep a separate record of the slugs and permalinks off site, so updating a clean table will be much quicker than to redo everything form the start.
    PS: the JetMenu support have been unsuccessful for a far too long time to find a solution – perhaps that battle is also due to gremlins that arose from the export/import process.

    Moderator bcworkz

    (@bcworkz)

    The slug-2 issue is independent of the menu link issue, so I cross posted the relevant part of your reply to your other thread and will address your slug question there.

    As for the menu link issue, what is happening is it’s linking to a category term archive /annual-events/ and it should be linking to a page /annual-events/. I don’t know how to make JetMenu do this, but it seems like there ought to be a way.

    A possible work around would be to assign the category term Annual Events to the respective events that appear on the Annual Events page. The events would have to be some sort of post type for this to work. Custom post types might not have the category taxonomy associated with it, but that can be made to happen with some additional code.

    Thread Starter tvejacques

    (@tvejacques)

    bcworkz thanks again.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Linked page result differs between link in Content Block and in Navigation Block’ is closed to new replies.