• Hi everyone,

    I’m trying to do this on a WordPress site:

    URL #1 is http://www.mysite.com/somepage
    – this displays the page properly

    URL #2 is http://www.mysite.com/somepage?somecondition
    – this displays the same page, BUT it adds the linked image inside the page’s content

    The goal: If we have a page with some download link or image, we want that link to show to people that only access the page using the URL with a condition on it. Users who don’t have that URL will be able to see the regular page, but without that image.

    Unfortunately, I cannot use the “only registered users can see some content” option/solution here, as the site is specific.

    P.S. The page/post that should be working like this is Custom Post Type.

    Can you please let me know your thoughts on this?

    I REALLY need your help 🙂 Please let me know ANYTIME if there’s any more information that I can provide. Thank you so much!!!

Viewing 1 replies (of 1 total)
  • I think you can do what you want using a shortcode. Try adding this function to your functions.php:

    // Check URL for a parameter
       function check_url_func($atts,$content='') {
          if (isset($_GET['somecondition'])) {
             return $content;
          }
          return '';
       }
       add_shortcode('check_url','check_url_func');

    and then enclose the restricted content in the shortcode tags like this:

    [check_url]content here[/check_url]
Viewing 1 replies (of 1 total)
  • The topic ‘Display Specific Content using URL Variable’ is closed to new replies.