[Support request] Is it possible to show the post type in the list?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Is it possible to show the post type in the list?

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #29188
    elvin
    Moderator

    Well if we’re going to completely replace the $time_string with whatever was coming from The Events plugin then the link is completely wiped along with the default time string as it will be replaced by $output = tribe_events_event_schedule_details($null, $before = 'Event date: '); 🙂

    #29196
    Joon
    Participant

    Yeah I get that 🙂

    What I mean is how I get the links removed from the dates in the traditional posts without messing up the code that shows the schedule details for events.

    #29229
    elvin
    Moderator

    We can still use the previous filter you’ve been using to remove the date links.

    Let’s try combining both into 1 filter:

    Try this:

    add_filter( 'wpsp_date_output', 'tu_wpsp_remove_date_link' );
    function tu_wpsp_remove_date_link( $output, $time_string ) {
        if ( 'tribe_events' == get_post_type() ) { 
            $output = tribe_events_event_schedule_details($null, $before = 'Event date: ');
        } else {
            $time_string = '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';
    
            if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
                $time_string .= '<time class="wp-show-posts-updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
            }
    
            $time_string = sprintf( $time_string,
                esc_attr( get_the_date( 'c' ) ),
                esc_html( get_the_date() ),
                esc_attr( get_the_modified_date( 'c' ) ),
                esc_html( get_the_modified_date() )
            );
    
            $output = printf(
                '<span class="wp-show-posts-posted-on wp-show-posts-meta">%1$s</span>',
                $time_string
            );
        }
    
        return $output;
    }

    Let us know how it goes.

    #29247
    Joon
    Participant

    Unfortunately that code does not work. The page does not look right.

    I have it activated on a demosite so no other plugins or code snippets should be messing with the code: (https://museo.eitcon.com/)

    #29472
    Joon
    Participant

    I gather this would be hard to solve?

    #29491
    elvin
    Moderator

    this is certainly doable we just need to tweak the code.

    The problem lies on this part

        if ( 'tribe_events' == get_post_type() ) { 
            $output = tribe_events_event_schedule_details($null, $before = 'Event date: ');
        }

    I’m not exactly sure what this tribe_events_event_schedule_details does(this part/function is out of our scope to be frank.). I only assumed it outputs a string based on your reply but perhaps that’s not the case.

    Can you do a var_dump of tribe_events_event_schedule_details($null, $before = 'Event date: ');?

Viewing 6 posts - 16 through 21 (of 21 total)
  • You must be logged in to reply to this topic.