Title: exclude an attribute from a short code
Last modified: June 28, 2017

---

# exclude an attribute from a short code

 *  [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/)
 * _[ Moderator note: [moved to Fixing WordPress](https://wordpress.org/support/topic/before-posting-in-everything-wordpress/?view=all).
   Please do not use Developing with WordPress for these topics. ]_
 * Hello and thank you in advance for your time! We are using a custom theme for
   our wp site, which is connected to a wordpress database where families can create
   their own profiles.
 * The web site pulls family profiles from that database via a shortcode, which 
   is the database name:
    On this page: [https://lifetimeadoption.com/west-region/](https://lifetimeadoption.com/west-region/)
   through this shortcode: [ltadb region=”W” perpage=”15″]
 * I created a new custom field/attribute called afl_family and want to exclude 
   all who choose “yes” from the display.
 * When I add: [ltadb region=”W” afl_family=”N” perpage=”15″]
    even though only 
   one family meets this criteria, a bunch of profiles are excluded.
 * Is there another way of writing this? Thanks for your help!
 * The blog I need help with is lifetimeadoption.com.

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/page/2/?output_format=md)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9270760)
 * Does the shortcode have that paramater? If not, did you edit the PHP code behind
   the shortcode to look for that parameter and process it?
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271073)
 * Hi Steve,
    Please see this link: [http://lifetimeadoption.com/testtesttest/](http://lifetimeadoption.com/testtesttest/) ‎
   Lmk know if you need anything else. Thank you! Julia
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271254)
 * I don’t know why you’re showing me that link. It has nothing to do with shortcodes,
   AFAICT. Please answer my questions.
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271304)
 * Sorry, it shows where I added the attribute into the query page so that i can
   use it in my short code.
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271307)
 * I thought that is what you mean by “parameter”?
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271356)
 * I assumed the shortcode was based on the install name (ltadb or c-name) Sorry
   I’m obviously not a strong php programmer! We use it in many sites in combination
   with the attributes like this:
    [ltadb afl_family=”Y” perpage=”15″] on this site
   [http://adoptionforlife.com/view-waiting-families/](http://adoptionforlife.com/view-waiting-families/)
 * I want to exclude these families from our main site lifetimeadoption.com but 
   it pulls out families that are not afl as well when I say:
 * [ltadb afl_family=”N” perpage=”15″]
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271361)
 * Where does that short code come from? That’s where you need to ask.
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271382)
 * I looked through the php files but couldn’t find it. Is there a page name that
   is common for defining short codes? Is there a string of code that is common 
   that I could use to search for it? I will keep looking. Thank you for clarifying!
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271396)
 * It’s either in a plugin or in your theme. Your theme was built by [http://mediajunction.com](http://mediajunction.com).
   Have you asked them?
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271406)
 * Unfortunately this was before my time and they did not provide support after 
   they built it.
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271412)
 * I found it. Its a plugin called Lifetime Database query…
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271416)
 * // Register the shortcodes
    add_shortcode( ‘ltadb’, array( &$this, ‘render_shortcode’));
   add_shortcode( ‘ltafamily’, array( &$this, ‘render_shortcode_2’ ) ); add_shortcode(‘
   ltabm’, array( &$this, ‘render_shortcode_3’ ) );
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271425)
 * function render_shortcode($atts) {
    //Select what attributes the short code is
   looking for $find_attributes = array( ‘state’ => ”, ‘military’ => ”, ‘aa’ => ”,‘
   biracial’ => ”, ‘older’ => ”, ‘previous_adoption’ => ”, ‘special’ => ”, ‘live_in’
   => ”, ‘spanish’ => ”, ‘religion’ => ”, ‘contact’ => ”, ‘drug’ => ”, ‘mental’ 
   => ”, ‘single’ => ”, ‘family_hispanic’ => ”, ‘family_african_american’ => ”, ‘
   family_asian’ => ”, ‘family_american_indian’ => ”, ‘family_caucasian_’ => ”, ‘
   open_to_east_indian’ => ”, ‘limit’ => ”, ‘region’ => ”, ‘perpage’ => ”, ‘fillpages’
   => ”, ‘bordercolor’ => ”, ‘borderwidth’ => ”, ‘nonavigation’ => ”, ‘video_embed’
   => ”, ‘any’ => ”, ‘agency_family’ => ”, ‘spotlight_family’ => ”, ‘tele’ => ”,‘
   featured’ => ”, ‘yh_old’ => ” );
 * I will add afl_family to this.
 * Question: I also have page-query.php with the same info in thisd install (previous
   screenshot in the link I gave you) and in the lifetime install. Why do I have
   it here and in 2 php docs? Is that necessary?
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271430)
 * adding “family” to the list will not do it. I think you should probably hire 
   a developer to address this for you before you break something. 🙂
 *  Thread Starter [Creatives](https://wordpress.org/support/users/julialifetime/)
 * (@julialifetime)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/#post-9271433)
 * I added
    ‘afl_family’ => ”,
 * then added
    [ltadb afl_family=”N” perpage=”15″] to the page but the afl family
   is still showing.
 * Getting closer though, thank you so much!

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/page/2/?output_format=md)

The topic ‘exclude an attribute from a short code’ is closed to new replies.

## Tags

 * [attribute](https://wordpress.org/support/topic-tag/attribute/)
 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 23 replies
 * 2 participants
 * Last reply from: [Creatives](https://wordpress.org/support/users/julialifetime/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/exclude-an-attribute-from-a-short-code/page/2/#post-9271565)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
