• Resolved lsilver

    (@lsilver)


    Is there any way to modify the output of the shortcode based upon either the underlying category of a blog post or the URL of the page.

    For example, if I have two blog categories: Apples and Oranges, and I’ve setup my permalinks so the URL is domain.com/apples/post and domain.com/oranges/post . . .

    I’d like to use the same shortcode, but if it’s an apples post display one piece of html (image/link) and if it’s oranges display another.

    In my specific situation, having two separate shortcodes won’t work due to how these posts are being created.

    Thanks.

    https://wordpress.org/plugins/shortcodes-ui/

Viewing 1 replies (of 1 total)
  • The logic would need to be in the PHP code (or *perhaps* in JavaScript…?). The ShortCodes UI plugin itself does not have that kind of conditional logic built in. You may also want to consider some form of conditional / dynamic widgets plugin if you want to avoid programming.

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Shortcode’ is closed to new replies.