Tagged: x
-
AuthorPosts
-
April 18, 2016 at 5:50 am #887994
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
April 18, 2016 at 5:53 am #888002This reply has been marked as private.April 18, 2016 at 7:58 am #888184Hi 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!
April 18, 2016 at 8:23 pm #889123fantastic that worked. many thanks!
April 19, 2016 at 5:16 am #889718You’re welcome!
April 20, 2016 at 2:55 am #891398One 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.
April 20, 2016 at 9:42 am #891889Hi 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 AccountDon’t forget to select Set as a private reply. This ensures your information is only visible to our staff.
Thanks.
April 20, 2016 at 10:15 pm #892886This reply has been marked as private.April 21, 2016 at 6:38 am #893467Hi 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.
April 21, 2016 at 6:58 pm #894493This reply has been marked as private.April 21, 2016 at 9:39 pm #894655I have already removed it. Hope it helps.
Let us know how it goes.
Thanks.
-
AuthorPosts