• Resolved sofiabsilva

    (@sofiabsilva)


    Hello, first of all thanks for the plugins and support given to others it’s helped me a bunch already.

    So, I’ve been having trouble with getting the plugin to work correctly on this website I’ve been developing (theme used is astra).
    I’d like to point out that I have found ways to make it usable (with the help of this support forum and tutorials), but the root of the problem is not yet solved, so I probably need some assistance.

    Here’s the two problems I’ve encountered (maybe not to be solved in this order)

    Problem #1: Highlighted menu items (when scrolling through the page) only showed up directly upon opening the site’s url when I was using the relative paths, for example (#contacto as opposed to https://visaoplus.pt/#contacto), when I changed it to absolute paths (to make sure those links still worked when accessing through another page) and after making adjustments in the stylesheet so that they weren’t all highlighted, they only show up when clicking any of the menu items of the front page (or when the url is for ex. https://visaoplus.pt/?#contacto). Yes, for some reason the “?” is always added when clicking a menu item. Could this be related to the problem?

    Problem #1: I’m using the shortcode (with the gutenberg blocks) like the following example:

    [ps2id_wrap id='contacto'] 
    ...content...
    [/ps2id_wrap]

    For some reason this is adding empty <p></p> tags in each of the sections that contain the shortcode. I ended up using this css rule to hide them. This worked fine whenever the “._mPS2id-t” class was active, so when the highlighting was working on scroll. At the moment, as stated before it only works when the url contains any of the hash, but not when seeing the site with the normal url (visaoplus.pt).

    div._mPS2id-t > p {
        display: none;
    }

    For this reason, so that there aren’t empty white spaces corresponding to the p tags, I had to add the following css rule as well.

    #sobre >p, #produtos >p, #contacto >p {
        display: none;
    }

    Can you help figuring out what’s happening here?
    Thank you so much.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    Problem #1: Yes, the problem is that your links have the ? character in their URL. This character is not added when clicking the menu links. It’s already there.

    Check your menu wp admin and make sure the URL is:

    https://visaoplus.pt/#contacto

    and not:

    https://visaoplus.pt/?#contacto

    You could also use the absolute-relative URL type (if you want) like this:

    /#contacto

    Problem #2:

    The issue with the empty first paragraph in the shortcode block seems to happen on the latest WordPress. Your CSS solution to this is the best.

    Fixing the first problem will also fix your second problem (since the CSS will apply). I’d only suggest to change your CSS to:

    div._mPS2id-t > p:empty:first-child {
        display: none;
    }

    This will hide only the first empty paragraph inside the ._mPS2id-t elements, so it won’t affect other p elements 😉

    Hope this helps

    Thread Starter sofiabsilva

    (@sofiabsilva)

    Thanks for the reply, thing is I don’t know why the ? appears there, on the menu settings I only put https://visaoplus.pt/#contacto.
    Any idea why that’s happening?

    Thread Starter sofiabsilva

    (@sofiabsilva)

    Nevermind, I changed the links to aboslute-relative and it doesn’t add the ?. Still weird why it was happening with the absolute links!

    Plugin Author malihu

    (@malihu)

    My guess is that either the theme or another plugin does this. Why it does it, I don’t know (I haven’t see this before), but it’s probably the theme.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problems with navigation with absolute links and shortcode adding p tags’ is closed to new replies.