Home › Forums › Calendar Products › Events Calendar PRO › Shortcode output on user profile page
- This topic has 5 replies, 3 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
November 17, 2015 at 7:01 pm #1027257
duellingpixels
ParticipantHi 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
November 17, 2015 at 10:33 pm #1027295Brook
ParticipantHowdy 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
November 18, 2015 at 1:25 pm #1027724duellingpixels
ParticipantHi 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
November 19, 2015 at 9:02 pm #1028357duellingpixels
ParticipantOk,
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
November 19, 2015 at 11:18 pm #1028370Brook
ParticipantAwesome! 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
February 18, 2016 at 8:31 am #1075720Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Shortcode output on user profile page’ is closed to new replies.
