Enable excerpts for venues?

Home Forums Calendar Products Events Calendar PRO Enable excerpts for venues?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1044777
    dtcaldwell
    Participant

    Is there a straightforward way to enable post Excerpts for Venues? We want to provide a directory page for all of our (150) venues, which is easy. If Venues could have excerpts, we could provide presentable short descriptions of each venue in the directory. Without excerpts all we can get are cropped chunks of the main content.

    I noticed you have a slick mechanism for customizing Venue slugs and labels. Is there a similar way to enable Excerpts?

    #1044974
    George
    Participant

    Hey @dtcaldwell,

    You should be able to do this without issue by using WordPress Core’s own function called “add_post_type_support()”, which you can read about in-depth here → https://codex.wordpress.org/Function_Reference/add_post_type_support

    Here’s an example of some code with it that you could add to your theme’s functions.php file to add excerpts to Venues:


    if ( class_exists( 'Tribe__Events__Main' ) ) {
    /**
    * Adds excerpts to the "Venue" post type.
    *
    * @link http://theeventscalendar.com/?p=1044777
    */
    function tribe_add_excerpts_to_venues() {
    add_post_type_support( Tribe__Events__Main::VENUE_POST_TYPE, 'excerpt' );
    }

    add_action( 'init', 'tribe_add_excerpts_to_venues' );
    }

    I hope this helps!

    Cheers,
    George

    #1045352
    dtcaldwell
    Participant

    Thanks, George. That works perfectly.

    #1048619
    George
    Participant

    Nice! Glad to hear it.

    Best of luck with your project,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Enable excerpts for venues?’ is closed to new replies.