• Resolved hupe13

    (@hupe13)


    I created a widget in the header, see in other pages and posts than in mentioned link (“Deutsch” or “English”). The widget is an own shortcode block executing php. This works in pages and posts, but it doesn’t in the mentioned category page. Why?

    Thank you very much.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi there,

    the widget is being output but the shortcode is returning an empty paragraph.
    Where did the shortcode come from? As i can only assume it is an issue with its function.

    Thread Starter hupe13

    (@hupe13)

    I tested it by provoking an error in my php code. Therefore pages and posts could not be displayed. The category page was displayed.
    In general, a shortcode should work as a header widget? If yes, I will test it further.
    Or How do I execute this php code to get the link?

    echo '<a href="';
    echo str_replace(" https:="" mydomain.tld="" en="" ","https:="" ",get_permalink());="" echo="" '"="">Deutsch</a>&nbsp;&nbsp;';
    • This reply was modified 2 years, 5 months ago by hupe13.
    Leo

    (@leohsiang)

    In general, a shortcode should work as a header widget?

    Absolutely 🙂

    Thread Starter hupe13

    (@hupe13)

    Ok, then this is a problem with my shortcode. Thank you very much.

    Leo

    (@leohsiang)

    No problem 🙂

    Thread Starter hupe13

    (@hupe13)

    Fixed it. Sorry, it was my mistake.

    Leo

    (@leohsiang)

    Glad to hear 🙂

    Thread Starter hupe13

    (@hupe13)

    The code above works, the widget configuration shows it so. I have entered it correctly.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Widget in header’ is closed to new replies.