• Creatives

    (@julialifetime)


    [ Moderator note: moved to Fixing WordPress. 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/
    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)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    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

    (@julialifetime)

    Hi Steve,
    Please see this link: https://lifetimeadoption.com/testtesttest/ ?
    Lmk know if you need anything else. Thank you!
    Julia

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    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

    (@julialifetime)

    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

    (@julialifetime)

    I thought that is what you mean by “parameter”?

    Thread Starter Creatives

    (@julialifetime)

    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
    https://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)

    (@sterndata)

    Volunteer Forum Moderator

    Where does that short code come from? That’s where you need to ask.

    Thread Starter Creatives

    (@julialifetime)

    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)

    (@sterndata)

    Volunteer Forum Moderator

    It’s either in a plugin or in your theme. Your theme was built by https://mediajunction.com. Have you asked them?

    Thread Starter Creatives

    (@julialifetime)

    Unfortunately this was before my time and they did not provide support after they built it.

    Thread Starter Creatives

    (@julialifetime)

    I found it. Its a plugin called Lifetime Database query…

    Thread Starter Creatives

    (@julialifetime)

    // 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

    (@julialifetime)

    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)

    (@sterndata)

    Volunteer Forum Moderator

    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

    (@julialifetime)

    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)
  • The topic ‘exclude an attribute from a short code’ is closed to new replies.