Slickr Flickr
[resolved] Using a variable instead of a tag... (2 posts)

  1. Jim R
    Posted 6 years ago #

    I will be using this plugin on a Tag Archive page within my WordPress site. I would like the Tag name for that page to be the same used by this plugin. So if you click on John Doe's name it takes the User to a page where all the Posts tagged with John Doe's name are, and I would also like to see pictures of John Doe as well.

    So basically I would like the short code to look like:

    [slickr-flickr tag= $name]

    instead of...
    [slickr-flickr tag="bahamas"]

    Will that work?

  2. Russell Jamieson
    Plugin Author

    Posted 6 years ago #

    Hi Jim,

    No. WordPress will not substitute variables automatically into short codes.

    However, you can achieve the same effect by installing the Exec-PHP plugin and rather than using the slickr-flickr short code call PHP directly instead

    Something like..

    if(get_query_var('author_name')) :
        $curauth = get_user_by('slug', get_query_var('author_name'));
    else :
        $curauth = get_userdata(get_query_var('author'));
    $name = $curauth->user_nicename; //for example
    echo slickr_flick_display(array('tag' => $name) );

    This assumes that you put the required tag in the $name variable.

    Hope this helps.

    BTW, please post any questions on my plugin site, http://slickr-flickr.diywebmastery.com as that way you will get a quicker response, as I get an automatic email where there is a question.




Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Slickr Flickr
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic