• I have created a shortcode that display table content from another custom post type call with social media buttons somewhere in between, [table-list].

    When I apply this shortcode to my page, all the contents are properly query from the custom post type. However the social media buttons aren’t, they are getting the custom post type url instead of the page url itself.

    How can I fix this? Is there any other options then get_permalink()? Is there a way that can obtain the current page/post url where the shortcode is being applied?

Viewing 1 replies (of 1 total)
  • Are you using query_posts() in the shortcode? If so, replace it with a call to new WP_Query() and use wp_reset_query() after all your custom posts are displayed.

Viewing 1 replies (of 1 total)
  • The topic ‘Obtain parent url from a shortcode where it is being applied?’ is closed to new replies.