Question of incorporaring PHO inside of Shortcode

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  databell 1 year, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #167703

    databell
    Participant
    Post count: 1

    King of confusing but I’m trying to integrate another plugin’s shortcode inside of my client’s pods. The plugin i question is GigPress to display our dates. The idea is to use either their shortcode or widget code to display dates for one artst in the roster. So I have in my Artists’ pod a text field called gigs which related to the GigPress gig ID number. In this case…1. So here’s how it would work hard coded:

    So that’s OK but what about dynamically changing that ID to display the variable I have assigned in my pod’s field? So I tried this:

    That just protrudes blanks. No dates at all.So how would I embed this. Or can I?

    #167704

    sc0ttkclark
    Keymaster
    Post count: 813

    Oops, you’ve got it a bit wrong but it’s a simple fix.

    #167705

    databell
    Participant
    Post count: 1

    Unfortunately, Scott. That didn’t work. It should have returned a ’1′ (without the apostrophes, of course) and display dates. Instead it said ‘No Shows"…and I’m wondering why that would happen. It is possible, it’s displaying <p>1</p> instead of just 1? I notice a number of times the pod results incorporate <p> tags which quite frankly, I’d like to eliminate.

    #167706

    sc0ttkclark
    Keymaster
    Post count: 813

    If $artists_gigs is not working, try to do a <?php var_dump( $artists_gigs ); ?> which will show you exactly what that value really contains on output.

    If it’s got html in it, just do a <?php $artists_gigs = strip_tags( $artists_gigs ); ?> to take the tags out, and <?php $artists_gigs = (int) $artists_gigs; ?> to force the integer.

    #167707

    databell
    Participant
    Post count: 1

    Interesting I used the dump command and I got this in my code:

    "
    I’m going to try the strip_tags code next. Thanks, Scott. If you have an explanation of what the means, let me know. Really curious.

    #167708

    databell
    Participant
    Post count: 1

    OK, I think I got it. This seems to work:

    Thanks again, Scott…for all your help and assistance.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting