Shortcode output on user profile page

Home Forums Calendar Products Events Calendar PRO Shortcode output on user profile page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1027257
    duellingpixels
    Participant

    Hi All,

    I trying to link up a default wordpress user with a selected organiser, to list the user’s (& organiser’s) events on their profile page and I am using ACF (Advance Custom fields) to provide the link.

    I have added a custom field to the user’s profile to which the shortcode [tribe_events_list organizer=””] can be entered. Then using a author template file, outputting the code via do_shortcode, like as followings.

    do_shortcode(the_field(‘event_organizer_shortcode’, ‘user_’. $author_id ));

    Unfortunately, nothing is generated. I have tried everything that I can find via google to get the shortcode to work, but nothing is proving successful.

    The only thing that I can isolate the problem to is that the user profile page does not process the tribe_event shortcodes. As I have also added the shortcode into the user description field too, with no output success.

    How could I make this happen, is there a way to process the tribe_event shortcodes in a template file for each user?

    Cheers,

    Nick

    #1027295
    Brook
    Participant

    Howdy Nick,

    That is a cool idea. Sounds like you are going to show the author’s events on their page?

    I am wondering it the field itself is HTML encoded. If you temporarily remove do_shortcode() and just output this:

    the_field(‘event_organizer_shortcode’, ‘user_’. $author_id )

    What happens? Do you get output? Are the HTML characters like quotes encoded in source code, like are they a quote or are they " ?

    Does that all make sense? Please let me know.

    Cheers!

    – Brook

    #1027724
    duellingpixels
    Participant

    Hi Brook,

    Thanks for getting back to me.

    Yes, I have tried using the default the_feild of the field with no success of any output, and also the if(get_the … method as well.

    The line so of code I have tried in the template are:

    the_field( ‘event_organizer_shortcode’, ‘user_’. $author_id );

    or

    if( get_field(‘event_organizer_shortcode’, ‘user_’. $author_id )):
    the_field(‘event_organizer_shortcode’, ‘user_’. $author_id );
    endif;

    or

    do_shortcode(the_field(‘event_organizer_shortcode’, ‘user_’. $author_id ));

    or

    apply_filters(‘the_content’, get_post_meta($author_id->ID, ‘event_organizer_shortcode’, true));

    do_shortcode( the_field(‘event_organizer_shortcode’, ‘user_’. $author_id ) ) );

    Further up the template I am using the_field(‘author_description’, ‘user_’. $author_id ); which does generate an output for that field. Add to the fact when using a shortcode [tribe_events_list] in the user Biographical Info which also does not generate a output, just the straight shortcode it just shown on the front end.Link

    I wonder if the Tribe shortcodes are being processed at all on user profile page, I could understand why they wouldn’t.

    Any thoughts?

    Cheers,

    Nick

    #1028357
    duellingpixels
    Participant

    Ok,

    I have managed to resolve the output processing with the following code:

    $author_id = get_the_author_meta(‘ID’);
    $author_badge = get_field(‘your_field_name’, ‘user_’. $author_id );

    ?><div class=”entry” > <?php echo do_shortcode( $author_badge ); ?> </div> <?php

    However, the shortcode doesn’t seem to process the shortcode arguments correctly. To confirm the organiser argument should be used like [tribe_events_list organizer=”#10203″ limit=”2″] ? .

    Cheers,

    Nick

    #1028370
    Brook
    Participant

    Awesome! I am happy you were able to figure out which the_field() portion.

    Are you now seeing the shortcode text output on the frontend? Is the area where the shortcode should be blank or are you seeing this text:

    [tribe_events_list organizer="#123" limit="2"]

    You do have the syntax right. Try using that shortcode in a page and you should see some results. If you don’t, then it’s not the syntax but rather that organizer probably doesn’t have upcoming events.

    • Brook
    #1075720
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Shortcode output on user profile page’ is closed to new replies.