Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1403066

    Steve C
    Participant

    Hi Guys,

    I’m using Event Espresso on a site and I’d like to use the Cornerstone Editor to style the venue pages. However it’s not showing as an option in Cornerstone Settings. It’s not a deal-breaker, but it would be great to continue the style of the site through all the pages if possible.

    Any idea if Cornerstone can be tweaked to allow this?

    Many thanks, URL in private message next…

    SW

    #1403067

    Steve C
    Participant
    This reply has been marked as private.
    #1403374

    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    You can add this code to your child theme’s functions.php to allow specific post type for cornerstone.

    add_filter( 'cornerstone_allowed_post_types', 'espresso_post_types' );
    
    function espresso_post_types ( $allowed_types ) {
    $allowed_types[] = 'venue';
    return $allowed_types;
    }

    Replace venue with whatever post type your Espresso venue uses 🙂

    Hope this helps.

    #1403691

    Steve C
    Participant

    Thanks Rad,

    The post type is espresso_venues and I’ve added the code to functions.php.

    The Cornerstone tab is showing on the page editor but it doesn’t function. It’s not being offered as an option in the Cornerstone/Settings page either.

    Am I missing something obvious here?

    Steve

    #1403697

    Steve C
    Participant

    Bizarre,

    I’ve just retried adding a new venue and it works now. Albeit with some added padding etc… I can sort that I think.

    I’ve got a feeling this will be a struggle…

    Onwards and upwards!

    Thanks again!

    #1403739

    Steve C
    Participant

    If I was to add espresso_events to allowed_types using your code above do I just use the , as a separator?

    e.g. $allowed_types[] = ‘espresso_venues’ , ‘espresso_events’;

    Thanks in advance…!

    🙂

    S

    #1403839

    Rupok
    Member

    Hey there,

    You can try like this :

    add_filter( 'cornerstone_allowed_post_types', 'espresso_post_types' );
    
    function espresso_post_types ( $allowed_types ) {
      $allowed_types = array('espresso_venues', 'espresso_events');
      return $allowed_types;
    }

    Let us know how it goes.

    #1414819

    Steve C
    Participant

    Hi Rupok,

    I added that code and it has now stopped me from editing normal pages using Cornerstone, I just get the CS code in the editor and no Cornerstone option in the tabs?

    Any ideas?

    Best wishes,

    S

    #1415855

    Paul R
    Moderator

    Hi Steve,

    Kindly change the code to this.

    
    add_filter( 'cornerstone_allowed_post_types', 'espresso_post_types' );
    
    function espresso_post_types ( $allowed_types ) {
      array_push($allowed_types,"espresso_venues", "espresso_events");
      return $allowed_types;
    }
    

    Hope that helps.