Shortcode

This topic contains 22 replies, has 3 voices, and was last updated by  Peter Wesche 7 years, 8 months ago.

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #23654

    i added the snippets and insert this shortcode to the page:

    [eo_events events_by_current_title]
    %event_title%
    in %event_venue%
    am %start{j. F o}%
    [/eo_events]

    Then it should displays all Events with the Post-Title. (E.g. in this case “massagetherapeut”)
    But it shows all Events.

    What did i wrong?
    Here u can see it?:
    http://b9icqu9.myraidbox.de/kurse/massagetherapeut/

    Christoph Steinlechner
    #23671

    You should use the shortcode as follows:

    [events_by_current_title]
    

    you’ll need to add the template tags into the snippet I gave you before:

    add_shortcode( 'events_by_current_title', 'my_events_by_title' );
    function my_events_by_title( $atts, $content = null ){
            $event_id = get_the_ID();
            if ( 'event' !== get_post_type( $event_id ) ) {
                    return;
            }
    
            $title = get_the_title(); 
    
            return do_shortcode( "[eo_events title={$title} event_start_after=now]
                                   %event_title% in %event_venue% am %start{j. F o}%
                                   [/eo_events]" );    
     }
    
    Stephen Harris
    #23682

    hmm i add this … but no dates are showing … i tryed also this
    return do_shortcode( “[eo_events]” );

    to see if something is showing … but no events are showing.

    Christoph Steinlechner
    #23708

    Ah, I”m sorry, this is being used on a regularly post/page isn’t it. Please remove the lines:

    if ( 'event' !== get_post_type( $event_id ) ) {
        return;
    }
    
    Stephen Harris
    #23709

    ui it works close ..
    can i set instead of this:<br />
    %event_title% in %event_venue% am %start{j. F o}%

    this?:

    <div class=”column one-fourth”>%event_title%
    </div>

    <div class=”column one-fifth”>%event_venue%</div>

    <div class=”column one-fourth”>%start{j.m.}% – %end{j.m.o}%</div>

    <div class=”column one-fifth”>Jetzt buchen</div>

    cause i need a clear list with styling.

    Christoph Steinlechner
    #23757

    Yes, but at this point I think you’re better off removing the placeholders entirely and editing the template file instead (see Customising the look of the event list of http://docs.wp-event-organiser.com/shortcodes/events-list/)

    Stephen Harris
    #23782

    u mean shortcode-templatefile i guess … maybe i in future … now its to much input for me … i am not a developer … or u can do it and u can make me an offer how much it cost?

    Christoph Steinlechner
    #23799

    great, Stephen, thats what i was looking for too! thanks Christoph.

    Peter Wesche
Viewing 8 posts - 16 through 23 (of 23 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.