Editing the Events page

Home Forums Calendar Products Events Calendar PRO Editing the Events page

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #824350
    theimageworks
    Participant

    The events page is setting the page featured image and page title to that of the last edited event. Please can you help resolve this issue.

    I ideally would like it to show the next upcoming event but setting a default title and featured image for this page would suffice.

    Thanks in advance.

    #824487
    Brian
    Keymaster

    Hello theimageworks,

    Sorry for the issues you are having, I can help get this back on track with you.

    I am unclear on exactly what you are asking. Could you clarify these statements:

    The events page is setting the page featured image and page title to that of the last edited event. Please can you help resolve this issue.

    Please provide the url’s for where this is happening.

    Let me know and we can go from there.

    Thanks

    #824643
    theimageworks
    Participant

    This reply is private.

    #825029
    Brian
    Keymaster

    Ok that makes sense now. I am afraid that is done from your theme and not part of the Events Calendar.

    It looks like your theme pulls the first featured image it can find to place in that area.

    Not knowing how that coding work I would assume you would have to go in and modify that function using some of these conditionals on this page:

    https://gist.github.com/jo-snips/2415009

    To target the main Events Page.

    Unfortunately, all my tips are going to be similar to that that as we do not have your theme and it is beyond the support we can provide on the forum for theme compatibility changes.

    #826552
    theimageworks
    Participant

    It’s just a theme that is part of the Genesis Framework so nothing too fancy. The only thing different is that I can set featured images on pages as well as posts.

    I have the following code to move the page title over the featured image:

    if ( tribe_is_event() ) {

    echo ‘<div class=”entry-header-wrapper”><div class=”wrap”><div id=”title-desc”>’;
    genesis_do_post_title();
    echo ‘<p>We hope to see you there!</p>’;
    echo ‘</div></div></div>’;

    remove_action( ‘genesis_entry_header’, ‘genesis_entry_header_markup_open’, 5 );
    remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    remove_action( ‘genesis_entry_header’, ‘genesis_entry_header_markup_close’, 15 );

    If the events page had its own physical page it would be a piece of cake but unfortunately is doesn’t.

    So from what you’re saying I guess I need to add something along the lines of:

    if( tribe_is_month() ) {
    set the page featured image to xxxc.jpg
    }

    #826556
    theimageworks
    Participant

    Oh sorry and the code i have to set the featured image is as follows:

    wp_enqueue_script( ‘sk-backstretch’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/jquery.backstretch.min.js’, array( ‘jquery’ ), ‘1.0.0’ );
    wp_enqueue_script( ‘sk-backstretch-set’, get_bloginfo(‘stylesheet_directory’).’/js/backstretch-set.js’ , array( ‘jquery’, ‘sk-backstretch’ ), ‘1.0.0’ );

    wp_localize_script( ‘sk-backstretch-set’, ‘BackStretchImg’, array( ‘src’ => str_replace( ‘http:’, ”, genesis_get_image( array(‘format’ => ‘url’) ) ) ) );

    #826811
    Brian
    Keymaster

    So I think you are on the right track.

    I added some notes below to your comments.

    If the events page had its own physical page it would be a piece of cake but unfortunately is doesn’t.

    Yes, cake would be good. 🙂 I also have a little trouble integrating with Genesis on building my own sites I usually go and directly edit the templates to get it how I want it to work.

    As you say:

    So from what you’re saying I guess I need to add something along the lines of:

    if( tribe_is_month() ) {
    set the page featured image to xxxc.jpg
    }

    Something like that would be the way I would do it. You would have to add && !tribe_is_month() to this conditional tribe_is_event() for your first if statement.

    You may have to add a conditional on this as well and directly set the url to a default image instead of using genesis_get_image. (Just gave a presentation on using the Genesis Framework and did not even know that was a function, learn something new every day!)

    wp_localize_script( ‘sk-backstretch-set’, ‘BackStretchImg’, array( ‘src’ => str_replace( ‘http:’, ”, genesis_get_image( array(‘format’ => ‘url’) ) ) ) );

    Let me know if you can get that working or have any more questions and I can try to answer them.

    Thanks

    #831875
    theimageworks
    Participant

    Awesome, I’ve resolved this now. Thank you for your help!

    #832345
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need any other on something else please post a new ticket.

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Editing the Events page’ is closed to new replies.