Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1221425

    The Fox Magazine
    Participant

    I uploaded the child theme for ethos and copied the wp-header.php file path to it, then added the following code to allow me to add revolution sliders to the category pages:

    <?php 
      if ( is_category('3') ):
        echo do_shortcode('[rev_slider alias="photographyslider"]');
      elseif ( is_category('33') ):
        echo do_shortcode('[rev_slider alias="fashion-slider"]'); 
      elseif ( is_category('2') ):
        echo do_shortcode('[rev_slider alias="travel-slider"]');
      elseif ( is_category('4') ):
        echo do_shortcode('[rev_slider alias="technology-slider"]'); 
      elseif ( is_category('31') ):
        echo do_shortcode('[rev_slider alias="music-slider"]');
      elseif ( is_category('32') ):
        echo do_shortcode('[rev_slider alias="food-slider"]'); 
      elseif ( is_category('72') ):
        echo do_shortcode('[rev_slider alias="photos-of-the-week-slider"]');
      endif;
    ?>

    I didn’t have this issue before installing the child theme and adding this customization. Open Graph is turned off in the customization>social setting, and I’ve tried deleting and re-installing the Yoast SEO plugin several times as well as deactivating and reactivating all plguins.

    Facebook debugger says this for the following link: http://www.thefoxmagazine.com/travel/its-better-in-the-bahamas/

    Inferred Property
    The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.
    Inferred Property
    The ‘og:url’ property should be explicitly provided, even if a value can be inferred from other tags.
    Inferred Property
    The ‘og:title’ property should be explicitly provided, even if a value can be inferred from other tags.
    Inferred Property
    The ‘og:description’ property should be explicitly provided, even if a value can be inferred from other tags.
    Inferred Property
    The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.

    However, when I inspect and look into the HTML I see that Yoast SEO is placing the og tags in the body of the html instead of the head as it should. Before this occured it showed that the articles were in maintenance mode when shared on Facebook? I am very confused and have been trying to solve this issue for two days. All help is appreciated!

    #1221444

    The Fox Magazine
    Participant

    Update: I successfully debugged maintenance mode issue, but the major issue is still destroying my soul and website

    #1221880

    Rupok
    Member

    Hi there,

    I have checked and I can see the og title, description etc within the head tag – http://prntscr.com/cw44yq

    So it should not cause any issue.

    Cheers!

    #1223295

    The Fox Magazine
    Participant

    That is the case on the homepage, but not the case on category pages. Check the screenshot:

    Category Page Screenshot

    #1223313

    The Fox Magazine
    Participant

    It seems as if something is placing incorrect og tags in the beginning of the html which is forcing yoast seo to place them in the body on category pages, and this only occurs when the child theme is activated. This is over my head in terms of coding abilities to solve the issue and I am SO CONFUSED haha

    #1223436

    Rue Nel
    Moderator

    Hello There,

    Would you mind sharing the contents of the wp-header.php file present in your child theme? The original code should be this:

    <?php
    
    // =============================================================================
    // VIEWS/ETHOS/WP-HEADER.PHP
    // -----------------------------------------------------------------------------
    // Header output for Ethos.
    // =============================================================================
    
    ?>
    
    <?php x_get_view( 'global', '_header' ); ?>
    
      <?php x_get_view( 'global', '_slider-above' ); ?>
    
      <header class="<?php x_masthead_class(); ?>" role="banner">
        <?php x_get_view( 'ethos', '_post', 'carousel' ); ?>
        <?php x_get_view( 'global', '_topbar' ); ?>
        <?php x_get_view( 'global', '_navbar' ); ?>
        <?php x_get_view( 'ethos', '_breadcrumbs' ); ?>
      </header>
    
      <?php x_get_view( 'global', '_slider-below' ); ?>
      <?php x_get_view( 'ethos', '_landmark-header' ); ?>

    You can only add some lines but should not remove any of those lines.

    Please let us know how it goes.

    #1224425

    The Fox Magazine
    Participant

    This is the php file in the child theme:

    <?php
    
    // =============================================================================
    // VIEWS/ETHOS/WP-HEADER.PHP
    // -----------------------------------------------------------------------------
    // Header output for Ethos.
    // =============================================================================
    
    ?>
    
    <?php x_get_view( 'global', '_header' ); ?>
    
      <?php x_get_view( 'global', '_slider-above' ); ?>
    
      <header class="<?php x_masthead_class(); ?>" role="banner">
        <?php x_get_view( 'ethos', '_post', 'carousel' ); ?>
        <?php x_get_view( 'global', '_topbar' ); ?>
        <?php x_get_view( 'global', '_navbar' ); ?>
        <?php x_get_view( 'ethos', '_breadcrumbs' ); ?>
      </header>
    
      <?php x_get_view( 'global', '_slider-below' ); ?>
      <?php x_get_view( 'ethos', '_landmark-header' ); ?>
    
    // Revolution Slider output on Category pages
    
    <?php
      if ( is_category('3') ):
        echo do_shortcode('[rev_slider alias="photographyslider"]');
      elseif ( is_category('33') ):
        echo do_shortcode('[rev_slider alias="fashion-slider"]');
      elseif ( is_category('2') ):
        echo do_shortcode('[rev_slider alias="travel-slider"]');
      elseif ( is_category('4') ):
        echo do_shortcode('[rev_slider alias="technology-slider"]');
      elseif ( is_category('31') ):
        echo do_shortcode('[rev_slider alias="music-slider"]');
      elseif ( is_category('32') ):
        echo do_shortcode('[rev_slider alias="food-slider"]'); 
      elseif ( is_category('72') ):
        echo do_shortcode('[rev_slider alias="photos-of-the-week-slider"]');
      endif;
    ?>
    #1224871

    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the information. I have previewed the source of the page and here is what I’ve got;
    http://prntscr.com/cwy0bw

    I do not see any issue at all. I have checked the Facebook debugger and no warnings either.
    http://prntscr.com/cwy0kw

    Hope this helps.