Issue with php code to over write "Events Archive"

Home Forums Calendar Products Events Calendar PRO Issue with php code to over write "Events Archive"

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1178592
    Paula
    Participant

    Hi – We updated the pHp code as per your instructions here: https://theeventscalendar.com/knowledgebase/titles-in-yoast-seo/

    However, it is not working properly on our live site here http://squamishadventure.com/events/

    I have attached the code we updated – can you advise on what we are missing?

    Paula

    <?php
    /** Start Engine */
    require_once( get_template_directory().’/lib/init.php’ );
    /* Add HTML5 markup structure */
    add_theme_support( ‘html5’ );
    /** Localization */
    load_child_theme_textdomain( ‘prestige’, apply_filters( ‘child_theme_textdomain’, get_stylesheet_directory( ) . ‘/languages’, ‘prestige’ ) );
    /** DO Not Remove */
    define( ‘CHILD_THEME_NAME’, ‘Prestige’ );
    define( ‘CHILD_THEME_URL’, ‘http://demo.zigzagpress.com/prestige/&#8217; );
    /** Custom Post Types */
    require_once( get_stylesheet_directory( ) . ‘/include/cpt/super-cpt.php’ );
    require_once( get_stylesheet_directory( ) . ‘/include/cpt/zp_cpt.php’ );
    /** Theme Option/Functions */
    require_once ( get_stylesheet_directory( ) . ‘/include/theme_settings.php’ );
    require_once ( get_stylesheet_directory( ) . ‘/include/theme_functions.php’ );

    /** Theme Widgets */
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-flickr.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-address.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-social_icons.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-latest_portfolio.php’ );
    /** Theme Shortcode */
    require_once( get_stylesheet_directory( ) . ‘/include/shortcodes/shortcode.php’ );
    /** Unregister Layout */
    genesis_unregister_layout( ‘content-sidebar-sidebar’ );
    genesis_unregister_layout( ‘sidebar-sidebar-content’ );
    genesis_unregister_layout( ‘sidebar-content-sidebar’ );
    /** Unregister Sidebar */
    unregister_sidebar( ‘header-right’ );
    unregister_sidebar( ‘sidebar-alt’ );
    /** Unregister secondary navigation menu */
    add_theme_support( ‘genesis-menus’, array( ‘primary’ => __( ‘Primary Navigation Menu’, ‘prestige’ ) ) );
    /** Add Structural Wraps */
    add_theme_support( ‘genesis-structural-wraps’, array( ‘header’,’inner’, ‘footer-widgets’, ‘footer’ ) );
    /** Reposition Primary Nav */
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    add_action( ‘genesis_header’, ‘genesis_do_nav’, 11 );
    /** Remove Seondary Nav */
    remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );
    /** Theme Stylesheets */
    add_action( ‘wp_enqueue_scripts’, ‘zp_print_styles’ );

    #1179007
    Josh
    Participant

    Hey Paula,

    Thanks for reaching out to us!

    Would you mind adding your functions file as a gist on github (http://gist .github.com)? I’m not seeing your full file there with the code from the associated tutorial.

    Thanks!

    #1181017
    Paula
    Participant

    HI – I cant seem to upload to that site

    we are just trying to implement the code from here https://theeventscalendar.com/knowledgebase/titles-in-yoast-seo/

    but it is getting over written by SEO yoast

    We updated all plug ins but are still having trouble.

    Paula

    #1181019
    Paula
    Participant

    <?php
    /** Start Engine */
    require_once( get_template_directory().’/lib/init.php’ );
    /* Add HTML5 markup structure */
    add_theme_support( ‘html5’ );
    /** Localization */
    load_child_theme_textdomain( ‘prestige’, apply_filters( ‘child_theme_textdomain’, get_stylesheet_directory( ) . ‘/languages’, ‘prestige’ ) );
    /** DO Not Remove */
    define( ‘CHILD_THEME_NAME’, ‘Prestige’ );
    define( ‘CHILD_THEME_URL’, ‘http://demo.zigzagpress.com/prestige/&#8217; );
    /** Custom Post Types */
    require_once( get_stylesheet_directory( ) . ‘/include/cpt/super-cpt.php’ );
    require_once( get_stylesheet_directory( ) . ‘/include/cpt/zp_cpt.php’ );
    /** Theme Option/Functions */
    require_once ( get_stylesheet_directory( ) . ‘/include/theme_settings.php’ );
    require_once ( get_stylesheet_directory( ) . ‘/include/theme_functions.php’ );

    /** Theme Widgets */
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-flickr.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-address.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-social_icons.php’ );
    require_once( get_stylesheet_directory( ) .’/include/widgets/widget-latest_portfolio.php’ );
    /** Theme Shortcode */
    require_once( get_stylesheet_directory( ) . ‘/include/shortcodes/shortcode.php’ );
    /** Unregister Layout */
    genesis_unregister_layout( ‘content-sidebar-sidebar’ );
    genesis_unregister_layout( ‘sidebar-sidebar-content’ );
    genesis_unregister_layout( ‘sidebar-content-sidebar’ );
    /** Unregister Sidebar */
    unregister_sidebar( ‘header-right’ );
    unregister_sidebar( ‘sidebar-alt’ );
    /** Unregister secondary navigation menu */
    add_theme_support( ‘genesis-menus’, array( ‘primary’ => __( ‘Primary Navigation Menu’, ‘prestige’ ) ) );
    /** Add Structural Wraps */
    add_theme_support( ‘genesis-structural-wraps’, array( ‘header’,’inner’, ‘footer-widgets’, ‘footer’ ) );
    /** Reposition Primary Nav */
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    add_action( ‘genesis_header’, ‘genesis_do_nav’, 11 );
    /** Remove Seondary Nav */
    remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );
    /** Theme Stylesheets */
    add_action( ‘wp_enqueue_scripts’, ‘zp_print_styles’ );
    function zp_print_styles( ) {
    wp_register_style( ‘pretty_photo_css’, get_stylesheet_directory_uri( ).’/css/prettyPhoto.css’, ”, ‘3.1.5’ );
    wp_register_style( ‘flexslider-css’, get_stylesheet_directory_uri( ).’/css/flexslider.css’ , ”, ‘3.1.5’ );
    wp_register_style( ‘shortcode-css’, get_stylesheet_directory_uri( ).’/include/shortcodes/shortcode.css’ , ”, ‘1.4’ );
    wp_register_style( ‘mobile-css’, get_stylesheet_directory_uri( ).’/css/mobile.css’ ,”,’1.4′ );
    wp_register_style( ‘boxed-css’, get_stylesheet_directory_uri( ).’/css/boxed.css’ ,” , ‘1.4’ );
    wp_enqueue_style( ‘pretty_photo_css’ );
    wp_enqueue_style( ‘flexslider-css’ );
    wp_enqueue_style( ‘shortcode-css’ );

    $boxed_layout = genesis_get_option( ‘zp_boxed_layout’, ZP_SETTINGS_FIELD );
    if( $boxed_layout ){
    wp_enqueue_style( ‘boxed-css’ );
    }
    /** Custom Stylesheet */
    $color = strtolower( genesis_get_option( ‘zp_color_scheme’ , ZP_SETTINGS_FIELD ) );
    if( $color != ‘default’ ){
    wp_enqueue_style( ‘color_scheme-css’, get_stylesheet_directory_uri( ).’/css/color/’.$color.’.css’ );
    }

    wp_enqueue_style( ‘mobile-css’ );
    wp_enqueue_style( ‘custom-css’, get_stylesheet_directory_uri( ).’/custom.css’ );
    }
    /** Shortcode Styles */
    add_action( ‘admin_enqueue_scripts’, ‘zp_codes_admin_init’ );
    function zp_codes_admin_init( ){
    global $current_screen;
    if( $current_screen->base == ‘post’ ){

    //enqueue the script and CSS files for the TinyMCE editor formatting buttons
    wp_enqueue_script( ‘jquery’ );
    wp_enqueue_script( ‘jquery-ui-dialog’ );
    wp_enqueue_script( ‘jquery-ui-core’ );
    wp_enqueue_script( ‘jquery-ui-sortable’ );
    //set the style files
    add_editor_style( ‘/include/shortcodes/shortcode.css’ );
    wp_enqueue_style( ‘shortcode_editor_style’,get_stylesheet_directory_uri( ).’/include/shortcodes/shortcode_editor_style.css’ );
    }
    }
    /** Theme Scripts */
    add_action( ‘wp_enqueue_scripts’, ‘zp_theme_js’ );
    function zp_theme_js( ) {
    global $is_IE;

    wp_register_script( ‘jquery_custom’, get_stylesheet_directory_uri( ).’/js/jquery.custom.js’, array( ‘jquery’ ), ‘1.4’, true );
    wp_register_script( ‘jquery_easing_js’, get_stylesheet_directory_uri( ) . ‘/js/jquery-easing.js’,array( ‘jquery’ ), ‘1.3’, true );
    wp_register_script( ‘jquery_isotope_min_js’, get_stylesheet_directory_uri( ).’/js/jquery.isotope.min.js’,array( ‘jquery’ ), ‘1.5.04’, true );
    wp_register_script( ‘jquery_flexslider_js’, get_stylesheet_directory_uri( ).’/js/jquery.flexslider.js’,array( ‘jquery’ ), ‘2.0’, true );
    wp_register_script( ‘jquery_prettyphoto_js’, get_stylesheet_directory_uri( ) . ‘/js/jquery.prettyPhoto.js’,array( ‘jquery’ ),’3.1.6′, true );
    wp_register_script( ‘jQuery_ScrollTo_min_js’, get_stylesheet_directory_uri( ) . ‘/js/jquery.ScrollTo.min.js’,array( ‘jquery’ ) , ‘1.4.3.1’, true );
    wp_register_script( ‘jquery_tipTip’, get_stylesheet_directory_uri( ).’/js/jquery.tipTip.minified.js’,array( ‘jquery’ ), ‘1.3’, true );
    wp_register_script( ‘jquery_cycle’, get_stylesheet_directory_uri( ) . ‘/js/jquery.cycle.lite.js’,array( ‘jquery’ ) , ‘1.7’, true );
    wp_register_script( ‘jquery_carouFredSel’, get_stylesheet_directory_uri( ) . ‘/js/carousel/jquery.carouFredSel.min.js’, array( ‘jquery’ ), ‘6.2.1’ , true);
    wp_register_script( ‘jquery_mousewheel’, get_stylesheet_directory_uri( ) . ‘/js/carousel/jquery.mousewheel.min.js’,array( ‘jquery’ ), ‘3.0.6’ , true );
    wp_register_script( ‘jquery_touchswipe’, get_stylesheet_directory_uri( ) . ‘/js/carousel/jquery.touchSwipe.min.js’,array( ‘jquery’ ), ‘1.3.3’ , true);
    wp_register_script( ‘jquery_transit’, get_stylesheet_directory_uri( ) . ‘/js/carousel/jquery.transit.min.js’,array( ‘jquery’ ), ‘0.9.9’ , true);
    wp_register_script( ‘jquery_throttle’, get_stylesheet_directory_uri( ) . ‘/js/carousel/jquery.ba-throttle-debounce.min.js’, array( ‘jquery’ ), ‘1.1’ , true );
    wp_register_script( ‘css3-mediaqueries’, get_stylesheet_directory_uri( ) . ‘/js/css3-mediaqueries.js’, ”, ‘1.1’ , true );
    wp_enqueue_script( ‘jquery’ );
    wp_enqueue_script( ‘jquery-ui-tabs’ );
    wp_enqueue_script( ‘jquery_easing_js’ );
    wp_enqueue_script( ‘jquery_isotope_min_js’ );
    wp_enqueue_script( ‘jquery_prettyphoto_js’ );
    wp_enqueue_script( ‘jQuery_ScrollTo_min_js’ );
    wp_enqueue_script( ‘jquery_tipTip’ );
    wp_enqueue_script( ‘jquery_custom’ );

    // Conditionally check if the browser is IE then enqueue the script
    if ( $is_IE ){
    wp_enqueue_script( ‘css3-mediaqueries’ );
    }

    }
    /** Custom CSS */
    add_action( ‘wp_head’, ‘zp_custom_styles’ );
    function zp_custom_styles( ) {
    $css_custom = genesis_get_option( ‘zp_css_code’, ZP_SETTINGS_FIELD );
    if( $css_custom ){
    echo ‘<style type=”text/css”>’.$css_custom.'</style>’;
    }
    }
    /** Enable Top Section */
    add_action( ‘wp_head’, ‘zp_top_section_trigger’ );
    function zp_top_section_trigger( ) {
    $top_section = genesis_get_option( ‘zp_top_section’, ZP_SETTINGS_FIELD );
    if( $top_section == true ){
    echo ‘<style type=”text/css”>
    .top .wrap{
    display: block;
    }
    </style>’;
    }else{
    echo ‘<style type=”text/css”>
    .top .wrap{
    display: none;
    }</style>’;
    }
    }

    add_action( ‘wp_head’, ‘zp_custom_logo’ );
    function zp_custom_logo( ) {
    //real estate page
    if (is_page_template(‘page-real-estate.php’)) { ?>
    <style type=”text/css”>
    .header-image .site-header .title-area {
    background-image: url( “<?php echo get_stylesheet_directory_uri() . ‘/images/real-estate-logo-website.png’; ?>” );
    background-position: center center;
    background-repeat: no-repeat;
    }
    </style>
    <?php
    }
    else{
    if ( genesis_get_option( ‘zp_logo’, ZP_SETTINGS_FIELD ) ) {?>
    <style type=”text/css”>
    .header-image .site-header .title-area {
    background-image: url( “<?php echo genesis_get_option( ‘zp_logo’, ZP_SETTINGS_FIELD ); ?>” );
    background-position: center center;
    background-repeat: no-repeat;
    height: <?php echo genesis_get_option( ‘zp_logo_height’, ZP_SETTINGS_FIELD ); ?>px;
    width: <?php echo genesis_get_option( ‘zp_logo_width’, ZP_SETTINGS_FIELD ); ?>px;
    }
    </style>
    <?php }
    }
    }
    /** Enable Shortcode in the widget */
    add_filter( ‘widget_text’, ‘do_shortcode’ );
    /** Custom “Rread More” link */
    add_filter( ‘excerpt_more’, ‘zp_read_more_link’ );
    add_filter( ‘get_the_content_more_link’, ‘zp_read_more_link’ );
    add_filter( ‘the_content_more_link’, ‘zp_read_more_link’ );
    function zp_read_more_link( ) {
    return ‘… ‘.__( ‘Read More’,’prestige’ ).’»‘;
    }
    /** Custom Post Meta */
    add_filter( ‘genesis_post_meta’, ‘zp_post_meta_filter’ );
    function zp_post_meta_filter( $post_meta ) {
    $post_meta = ‘[post_categories sep=”, ” before=”<span>’.__( ‘Categories’,’prestige’ ).’: </span>”] [post_tags sep=”, ” before=”<span>’.__( ‘Tags’,’prestige’ ).’: </span>”]’;
    return $post_meta;
    }
    /** Add page title wrapper */
    add_filter( ‘genesis_after_header’,’zp_add_div’ );
    function zp_add_div( ){

    global $post;
    $img = ”;
    if( ( !is_home( ) || !is_front_page() ) && !is_page_template( ‘homepage-template.php’ ) ){
    if (is_page_template(‘page-real-estate.php’)) {
    $img_url = get_stylesheet_directory_uri() . ‘/images/realestate_header_page_image.jpg’;
    $style = ‘style=”background-image:url(‘ . $img_url . ‘); height:450px !important”‘;
    }
    else {
    if (isset($post))
    $img = get_post_meta($post->ID, ‘zp_page_image_value’, true);

    if ($img) {
    $url = wp_get_attachment_image_src($img, ‘full’);
    $img_url = $url[0];
    } else {
    $img_url = get_stylesheet_directory_uri() . ‘/images/default_header_page_image.jpg’;
    }

    $style = ‘style=”background-image:url(‘ . $img_url . ‘)”‘;
    }
    echo ‘<div class=”page_title_wrap” ‘.$style.’>’;
    }
    }
    /** Reposition Breadcrumbs*/
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘genesis_do_breadcrumbs’ );
    /** Custom breadcrumbs arguments*/
    add_filter( ‘genesis_breadcrumb_args’, ‘zp_breadcrumb_args’ );
    function zp_breadcrumb_args( $args ) {
    $args[‘sep’] = ‘ » ‘;
    $args[‘list_sep’] = ‘, ‘; // Genesis 1.5 and later
    $args[‘display’] = true;
    $args[‘labels’][‘prefix’] = ”;
    $args[‘labels’][‘author’] = __( ‘Archives for ‘,’prestige’ );
    $args[‘labels’][‘category’] = __( ‘Archives for ‘,’prestige’ ); // Genesis 1.6 and later
    $args[‘labels’][‘tag’] = __( ‘Archives for ‘,’prestige’ );
    $args[‘labels’][‘date’] = __( ‘Archives for ‘,’prestige’ );
    $args[‘labels’][‘search’] = __( ‘Search for ‘,’prestige’ );
    $args[‘labels’][‘tax’] = __( ‘Archives for ‘,’prestige’ );
    $args[‘labels’][‘post_type’] = __( ‘Archives for ‘,’prestige’ );
    $args[‘labels’][‘404’] = __( ‘404’,’prestige’ ); // Genesis 1.5 and later
    return $args;
    }
    /** Add Page Title */
    add_filter( ‘genesis_after_header’,’zp_page_title’ );
    function zp_page_title( ){
    global $post;
    $img=”;

    if( ( !is_home( ) || !is_front_page() ) && !is_page_template( ‘homepage-template.php’ ) ){
    echo ‘<div class=”title_wrap”>’;
    if ( is_category( ) ){
    $category = get_the_category( $post->ID );
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.__( ‘Archives for ‘, ‘prestige’ ).$category[0]->name.’

    ‘;
    }
    if( is_search( ) ){?>

    <span><?php __( ‘Archives for ‘, ‘prestige’ ); ?>'<?php the_search_query( ) ?>'</span>

    <?php }
    if ( is_author( ) ){
    $author = get_the_author_meta( ‘display_name’, $post->post_author );
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.__( ‘Archives for ‘, ‘prestige’ ).$author.’

    ‘;
    }
    if ( is_tag( ) ){
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.__( ‘Archives for ‘, ‘prestige’ ).single_tag_title( ”,FALSE ).’

    ‘;
    }
    if( is_post_type_archive( ‘portfolio’ ) ){
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    $post_type_title=post_type_archive_title( ”,false );
    echo ‘

    ‘.__( ‘Archives for ‘, ‘prestige’ ).$post_type_title.’

    ‘;
    }
    if ( is_single( ) && !is_singular( ‘portfolio’ ) ){
    echo ‘

    ‘.the_title( ”,”,FALSE ).’

    ‘;
    }
    if( is_singular( ‘portfolio’ ) ){
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.the_title( ”,”,FALSE ).’

    ‘;
    }
    if( is_tax( ‘portfolio_category’ ) ){
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.__( ‘Archives for ‘, ‘prestige’ ).single_tag_title( ”,FALSE ).’

    ‘;
    }
    if( is_page_template( ‘page_blog.php’ ) ){
    add_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    echo ‘

    ‘.the_title( ”,”,FALSE ).’

    ‘;
    }
    if( is_page( ) && !is_page_template( ‘page_blog.php’ ) ){
    echo ‘

    ‘.the_title( ”,”,FALSE ).’

    ‘;
    }
    if( is_404( ) ){
    echo ‘

    ‘.__( ‘404 – Page Not Found’, ‘prestige’ ).’

    ‘;
    }
    echo ‘</div>’;
    }
    }
    /** Page Description */
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘zp_add_page_desc’ );
    function zp_add_page_desc( ){
    global $post;
    $page_desc=”;

    if( isset( $post->ID ) )
    $page_desc = get_post_meta( $post->ID, ‘zp_page_desc_value’, true );
    if( $page_desc )
    echo ‘<div class=”page_desc”>’.do_shortcode( $page_desc ) .'</div>’;
    }
    /** Close Page Title*/
    add_filter( ‘genesis_after_header’,’zp_close_div’ );
    function zp_close_div( ){
    if( ( !is_home( ) || !is_front_page() ) && !is_page_template( ‘homepage-template.php’ ) )
    echo ‘</div>’;
    }
    /** Remove Post Title */
    add_action( ‘get_header’, ‘zp_remove_page_titles’ );
    function zp_remove_page_titles( ) {
    if ( ( is_page( ) || is_404( ) || is_single( ) ) && !is_page_template( ‘blog-template.php’ ) ) {
    remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ );
    }
    }
    /** Top Widget Area */
    add_action( ‘genesis_before_header’, ‘zp_above_header_ad’ );
    function zp_above_header_ad( ) {
    if( is_active_sidebar( ‘Top’ ) ): ?>
    <div class=”top_container”>
    <div class=”top”>
    <div class=”wrap”>
    <?php dynamic_sidebar( ‘Top’ ); ?>
    </div>
    <div class=”top_trigger open”></div>
    </div><!– end –>
    </div>
    <?php endif;
    }
    /** Background Support */
    add_theme_support( ‘custom-background’ );
    /** Custom Background Pattern*/
    add_action( ‘wp_head’, ‘zp_custom_background_pattern’ );
    function zp_custom_background_pattern( ) {
    $pattern = genesis_get_option( ‘zp_background_pattern’, ZP_SETTINGS_FIELD );
    if( $pattern ){
    echo ‘<style type=”text/css”>
    body {
    background-image: url( ‘.get_stylesheet_directory_uri( ).’/images/pattern/’.$pattern.’.png ) !important;
    background-repeat: repeat !important;
    background-position: center top !important;
    }
    </style>’;
    }
    }
    /** Meta for Mobile */
    add_action( ‘wp_head’,’zp_for_mobile’ );
    function zp_for_mobile( ){
    echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″ />’.”\n”;
    }
    /** To Top Link */
    add_action( ‘genesis_before_footer’,’zp_add_top_link’ );
    function zp_add_top_link( ){
    echo ‘ ↑ ‘. __( ‘Top of Page’,’prestige’ ) .’‘;
    }
    /** Footer Area */
    remove_action( ‘genesis_footer’, ‘genesis_do_footer’ );
    add_action( ‘genesis_footer’, ‘zp_do_custom_footer’ );
    function zp_do_custom_footer( ) {
    $copyright = genesis_get_option( ‘zp_footer_text’, ZP_SETTINGS_FIELD );?>
    <div class=”creds”>©
    <?php echo date( “Y” ); ?>
    <?php
    if( $copyright ){
    echo $copyright ;
    }else{
    bloginfo( ‘name’ ); ?> :: <?php bloginfo( ‘description’ );
    }?>
    </div>

    <?php if(is_active_sidebar( ‘bottom-widget’ ) ):?>
    <div class=”bottom-widget”>
    <div class=”widget”>
    <?php dynamic_sidebar( ‘bottom-widget’ ); ?>
    </div>
    </div><!– end –>
    <?php endif;?>
    <?php }
    /**
    * Blog Page
    **/

    /** Remove the post info function */
    remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 12 );
    remove_action( ‘genesis_entry_footer’, ‘genesis_post_meta’ );
    /** Add Post info Block */
    add_action( ‘genesis_entry_header’, ‘zp_add_post_block’, 1 );
    function zp_add_post_block( ){
    if ( is_page( ) || ! genesis_get_option( ‘content_archive_thumbnail’ ) )
    return;
    echo ‘<div class=”post_block” class=”clearfix”>’;
    }
    /** Custom Post Info */
    add_filter( ‘genesis_post_info’, ‘zp_post_info_filter’ );
    function zp_post_info_filter( $post_info ) {
    if ( !is_page( ) ) {
    $post_info = ‘[post_author_posts_link before=”<span>’.__( ‘Author’,’prestige’ ).’:</span>” ] [post_comments before=”<span>’.__( ‘Comment( s )’,’prestige’).’:</span>”]’;
    return $post_info;
    }}
    /** Reposition Post Info */
    add_action( ‘genesis_entry_header’, ‘genesis_post_info’,2 );
    /** Reposition Post Meta */
    add_action( ‘genesis_entry_header’, ‘genesis_post_meta’,3 );
    /** Add close post block <div> */
    add_action( ‘genesis_entry_header’, ‘zp_add_post_block_close’,4 );
    function zp_add_post_block_close( ){
    if ( is_page( ) || ! genesis_get_option( ‘content_archive_thumbnail’ ) )
    return;

    echo ‘</div>’;
    printf( ‘<div class=”post_content” class=”clearfix”>’ );
    }
    /** Post above Post Title */
    remove_action( ‘genesis_entry_content’, ‘genesis_do_post_image’, 8 );
    add_action( ‘genesis_entry_header’, ‘zp_generate_post_image’, 8 );
    function zp_generate_post_image( ) {
    if ( is_page( ) || !genesis_get_option( ‘content_archive_thumbnail’ ) )
    return;
    if ( ($image = genesis_get_image( array( ‘format’ => ‘url’, ‘size’ => genesis_get_option( ‘image_size’ ) ) ) ) && !is_single() ) {
    printf( ‘‘, get_permalink( ), $image );
    }
    }
    /** Post date After Post Title*/
    add_action( ‘genesis_entry_content’, ‘zp_add_post_date’, 1 );
    function zp_add_post_date( ){
    if ( is_page( ) || ! genesis_get_option( ‘content_archive_thumbnail’ ) )
    return;
    if( !is_single() )
    echo do_shortcode( ‘[post_date format=”F j, Y” label=””]’);
    }
    /** Add close post content </div> */
    add_action( ‘genesis_entry_footer’, ‘zp_add_post_content_close’, 11 );
    function zp_add_post_content_close(){
    if ( is_page( ) || ! genesis_get_option( ‘content_archive_thumbnail’ ) )
    return;

    echo ‘</div>’;

    }
    /** Widgets */
    genesis_register_sidebar( array(
    ‘name’=>’Top’,
    ‘id’ => ‘top’,
    ‘description’ => __( ‘This is the topmost section of the homepage.’,’prestige’ ),
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</div>’,
    ‘before_title’=>'<div class=”section-title”> <span>’,’after_title’=>'</span></div>’
    ) );
    genesis_register_sidebar( array(
    ‘name’=>’Home Widget’,
    ‘id’ => ‘home-widget’,
    ‘description’ => __( ‘This is the widget section of the homepage. This widget applies only to default homepage and not to Home Page Template’,’prestige’ ),
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</div>’,
    ‘before_title’=>'<div class=”section-title”> <span>’,’after_title’=>'</span></div>’
    ) );

    genesis_register_sidebar( array(
    ‘name’=>’Bottom Widget’,
    ‘id’ => ‘bottom-widget’,
    ‘description’ => __( ‘This is the widget area at the bottom of the page right of footer credits.’,’prestige’ ),
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</div>’,
    ‘before_title’=>'<div class=”section-title”> <span>’,’after_title’=>'</span></div>’
    ) );
    /** Footer Widget */
    add_theme_support( ‘genesis-footer-widgets’, 4 );/** Add widget title container */
    add_filter( ‘widget_title’, ‘zp_widget_title’ );
    function zp_widget_title( $title ){
    if( $title )
    return sprintf( ‘<span class=”widget-line”>%s</span>’, $title );
    }
    /** Include created image sizes in the WP media */
    add_filter( ‘image_size_names_choose’, ‘zp_custom_image_sizes’ );
    function zp_custom_image_sizes( $sizes ) {
    return array_merge( $sizes,
    array(
    ‘portfolio_single’ => __(‘Portfolio Single’, ‘prestige’ ),
    )
    );
    }
    /*
    * Add menu item description
    *
    * credits: Travis Smith
    * url: http://wpsmith.net/2011/tutorials/how-to-add-menu-descriptions-featured-images-to-wordpress-menu-items/
    *
    **/
    class Menu_With_Description extends Walker_Nav_Menu {
    function start_el(&$output, $item, $depth, $args, $id = 0) {
    global $wp_query;
    $class_names = $value = ”;

    $classes = empty( $item->classes ) ? array() : (array) $item->classes;

    $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item ) );
    $class_names = ‘ class=”‘ . esc_attr( $class_names ) . ‘”‘;

    $output .= ‘<li id=”menu-item-‘. $item->ID . ‘”‘ . $value . $class_names .’>’;

    $attributes = ! empty( $item->attr_title ) ? ‘ title=”‘ . esc_attr( $item->attr_title ) .'”‘ : ”;
    $attributes .= ! empty( $item->target ) ? ‘ target=”‘ . esc_attr( $item->target ) .'”‘ : ”;
    $attributes .= ! empty( $item->xfn ) ? ‘ rel=”‘ . esc_attr( $item->xfn ) .'”‘ : ”;
    $attributes .= ! empty( $item->url ) ? ‘ href=”‘ . esc_attr( $item->url ) .'”‘ : ”;

    // get user defined attributes for thumbnail images
    $attr_defaults = array( ‘class’ => ‘nav_thumb’ , ‘alt’ => esc_attr( $item->attr_title ) , ‘title’ => esc_attr( $item->attr_title ) );
    $attr = isset( $args->thumbnail_attr ) ? $args->thumbnail_attr : ”;
    $attr = wp_parse_args( $attr , $attr_defaults );

    $item_output = $args->before;

    // menu link output
    $item_output .= ‘<a’. $attributes .’>’;
    $item_output .= $args->link_before . apply_filters( ‘the_title’, $item->title, $item->ID ) . $args->link_after;

    // close menu link anchor
    $item_output .= ‘‘;
    // menu description output based on depth

    if( !empty( $item->description ) )
    $item_output .= ( $args->desc_depth >= $depth ) ? ‘<span class=”sub”>’ . $item->description . ‘</span>’ : ”;

    $item_output .= $args->after;

    $output .= apply_filters( ‘walker_nav_menu_start_el’, $item_output, $item, $depth, $args, $id );
    }
    }
    add_filter( ‘wp_nav_menu_args’ , ‘zp_add_menu_descriptions’ );
    function zp_add_menu_descriptions( $args ) {
    if ( $args[‘theme_location’] == ‘primary’ ) {
    //mintstone – switch to real estate menu if its a real estate page
    if(is_page_template(‘page-real-estate.php’)) {
    $args[‘menu’] = ‘real-estate-hub’;
    }
    $args[‘walker’] = new Menu_With_Description;
    $args[‘desc_depth’] = 0;
    $args[‘thumbnail’] = false;
    }
    return $args;
    }
    // Add mobile menu
    add_action( ‘genesis_header’, ‘zp_mobile_nav’, 10 );
    function zp_mobile_nav(){
    $output = ”;

    $output .= ‘<div class=”mobile_menu” role=”navigation”>’;
    $output .= ‘<span class=”icon-bar”></span><span class=”icon-bar”></span><span class=”icon-bar”></span>’;
    $output .= ‘</div>’;

    echo $output;
    }
    /* Add support for IE8 */
    add_action( ‘wp_head’, ‘zp_add_IE8_fixes’ );
    function zp_add_IE8_fixes(){
    echo ‘<!–[if IE 8]>
    <link rel=”stylesheet” type=”text/css” href=”‘.get_stylesheet_directory_uri( ).’/css/ie8.css”>
    <![endif]–>’.”\n”;
    }
    /**
    * Include Custom Theme Function
    *
    * Write all your custom functions in this file
    */

    require_once ( get_stylesheet_directory( ) . ‘/include/custom_functions.php’ );

    #1181021
    Paula
    Participant

    This is what my developers said:

    We’ve updated the plugins on staging and the code supplied doesn’t work. We suspect something has changed with Yoast SEO and the override this code is meant to perform no longer works.

    We can look at it more and rewrite it but it seems the best thing to do initially is get back to the Events calendar people and see if they can provide revised code.

    #1181034
    Paula
    Participant

    I am also wondering how you implement a custom fix in the code to change the meta title?

    Ex:
    Squamish Events & Festivals – Squamish Adventure

    #1182388
    Josh
    Participant

    Hey Paula,

    Thanks for following up here.

    I tested the snippet out and it appears to be working as expected. Looking closer at your functions file though, I’m not seeing the snippet in the mix there? Where are you currently adding that snippet? Is it within the “custom_functions.php” file linked at the bottom there?

    Thanks!

    #1182714
    Paula
    Participant

    Hi Josh,
    My developers replied the following:

    “Yes, the code is in the custom_functions.php file, but its not working for us at all. Where did he test the snippet out?
    It was working before updates to the plugins (events calendar and yoast)”

    #1183716
    Josh
    Participant

    Hey Paula,

    I’m testing using The Events Calendar and The Events Calendar PRO versions 4.3.1.1 and Yoast SEO version 3.7.1.

    Before adding the snippet (currently have Genesis theme installed with no child theme, however worked on 2016 as well) https://cloudup.com/cRzlPPnINbd.

    And after adding the snippet to the functions.php file I get the following https://cloudup.com/cr_j7iAXBGf

    Let me know if this helps.

    Thanks!

    #1194480
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Issue with php code to over write "Events Archive"’ is closed to new replies.