Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #887994

    nacho
    Participant

    Hi guys, loving the theme and all the info on these forums.

    I am using Ethos child theme with content and right sidebar. I have hidden the sidebar on category pages via custom css, but still can’t get the template right for individual posts.

    I would like the feature image (class is ‘entry-featured’ or ‘entry-thumb’) in blog posts to be full width so that the sidebar on the right starts below the image.

    I have seen some forum posts trying to do this sort of thing via javascript (insertBefore) or child theme php. Can you please advise how I can achieve this?

    Thanks

    #888002

    nacho
    Participant
    This reply has been marked as private.
    #888184

    Zeshan
    Member

    Hi Nacho,

    Thanks for writing in!

    The layout of the single post page is designed in a way that featured image and the main content area is separate from the sidebar. So it’s not easily possible to achieve your desired result without deep customization. That said, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

    So to achieve similar layout, first add following JS code under Custom > JavaScript in the Customizer:

    jQuery(document).ready(function($) {
      $('.single-post .entry-featured').insertBefore('.x-main');
    });
    

    Then insert following CSS code under Custom > CSS in the Customizer:

    .single-post .entry-featured {
      margin-bottom: 50px;
    }
    
    .single-post .entry-featured img {
      width: 100%;
    }
    

    Thank you!

    #889123

    nacho
    Participant

    fantastic that worked. many thanks!

    #889718

    Lely
    Moderator

    You’re welcome!

    #891398

    nacho
    Participant

    One more thing please. I have read through your great forum posts and have tried implementing social share icons at the end of all my blog posts. I added the following code in my child functions.php file, but all that shows up on the blog pages is the actual text, not the icons (ie. [share title=”Share this Post” facebook=”true” twitter=”true” google_plus=”true” linkedin=”true” pinterest=”true” reddit=”true” email=”true”] )

    The code I used was:

    function x_add_social_sharing ( $content ) {
      if ( is_singular('post') ) {
        echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
      }
    }
    add_action('x_before_the_content_end', 'x_add_social_sharing');

    I’d appreciate any assistance.

    #891889

    Thai
    Moderator

    Hi There,

    That code is working fine on my end.

    In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link login to your site
    – WordPress Admin username / Password
    – FTP Account

    Don’t forget to select Set as a private reply. This ensures your information is only visible to our staff.

    Thanks.

    #892886

    nacho
    Participant
    This reply has been marked as private.
    #893467

    Lely
    Moderator

    Hi There,

    Thank you for the credentials.
    I’ve change the code to this:

    function x_add_social_sharing ( $content ) {
      if ( is_singular('post') ) {
        echo do_shortcode('[x_share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
      }
    }
    add_action('x_before_the_content_end', 'x_add_social_sharing');

    It is now showing. See attached screenshot.

    #894493

    nacho
    Participant
    This reply has been marked as private.
    #894655

    Nico
    Moderator

    I have already removed it. Hope it helps.

    Let us know how it goes.

    Thanks.