Title: Passing WP Variable to a plugin
Last modified: August 18, 2016

---

# Passing WP Variable to a plugin

 *  [rubendn](https://wordpress.org/support/users/rubendn/)
 * (@rubendn)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/passing-wp-variable-to-a-plugin/)
 * I am trying to pass the title of a page to the get_flickrrss plugin.
 * Here is my code:
 * <?php $postname = $wp_query->post->post_title;?>
    <p align=’center’><?php get_flickrrss(
   7, “public”, $postname); ?></p>
 * If I do an echo right after the first line to test, the post title is properly
   assigned to $postname, but when I include it in the get_flickrrss function it
   passes a blank value. I’m not too proficient with PHP so I’m not sure if the 
   value has to be assigned another way to be able to pass it to the fucntion?
 * Would really appreciate any help.

Viewing 1 replies (of 1 total)

 *  Thread Starter [rubendn](https://wordpress.org/support/users/rubendn/)
 * (@rubendn)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/passing-wp-variable-to-a-plugin/#post-544318)
 * I modified the code to the following to do more testing…
 * <?php
    global $postname; $postname = $wp_query->post->post_title; echo $postname?
   > <p align=’center’><?php get_flickrrss(7, “public”, $postname); ?></p>
 * It does show the title of the post using the echo command but it does not properly
   pass the value to the get_flickrrss function.
 * If I change the last line to:
 * <p align=’center’><?php get_flickrrss(7, “public”, ‘dog’); ?></p>
 * it works fine and shows the 7 pictures of dogs.

Viewing 1 replies (of 1 total)

The topic ‘Passing WP Variable to a plugin’ is closed to new replies.

## Tags

 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 1 reply
 * 1 participant
 * Last reply from: [rubendn](https://wordpress.org/support/users/rubendn/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/passing-wp-variable-to-a-plugin/#post-544318)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
