-
AuthorPosts
-
May 1, 2015 at 2:37 pm #263277
Ok so i thought it is meant to be straightforward, but it doesnt seem to be so. I want social sharing buttons on all of my post pages i.e when a user clicks a link to a post, there should be sharing buttons on each post page. I’ve searched and searched around for this. Also, My sidebar is showing a brown background with 50×50 written all over it, i want just a white background. Kindly help please
May 1, 2015 at 8:56 pm #263481Hello There,
Implementing social sharing in blog posts will requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.
After that kindly add the code bellow in your functions.php.
add_action('x_before_the_content_end', function() { echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]'); });
You can modify the Entry Share shortcode inside the do_shortcode function. See http://theme.co/x/demo/integrity/1/shortcodes/entry-share/ for sample setups.
To remove the 50×50 background image. Go to Appearance > Customize > Layout and Design > BACKGROUND OPTIONS > Background Pattern and choose a new one. It will replace the 50×50 then press remove and it will remove your current and demo background image.
Hope that helps and kindly Let us know how this goes!
Thanks.
May 2, 2015 at 4:24 am #263699I setup the child theme by following the video tutorial in the link provided and added the code you wrote into the functions.php of the X-child. the only problem is that i hit save and then a blank page was just displaying. I checked my hosting control panel and used the editor there to edit the functions.php file and i found that the change was actually committed. However i went back to my site and then white page, nothing was displaying. Normally i set up an under construction page which used to show before but now nothing shows at all. before activating the child theme i made sure that i had exported the customizer settings and i imported them back after i activated the child theme. so what could i have done wrong.
May 2, 2015 at 4:28 am #263704Hi there,
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 to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
May 2, 2015 at 4:35 am #263705This reply has been marked as private.May 2, 2015 at 5:03 am #263712HI there,
I removed the code from functions.php and you site works fine now.
To add share buttons try this:
Copy content.php file from framework -> views -> ethos and put it in the same path inside child theme, Now replace existing code with this:
<?php // ============================================================================= // VIEWS/ETHOS/CONTENT.PHP // ----------------------------------------------------------------------------- // Standard post output for Ethos. // ============================================================================= $is_index_featured_layout = get_post_meta( get_the_ID(), '_x_ethos_index_featured_post_layout', true ) == 'on' && ! is_single(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( $is_index_featured_layout ) : ?> <?php x_ethos_featured_index(); ?> <?php else : ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-featured"> <?php if ( ! is_single() ) : ?> <?php x_ethos_featured_index(); ?> <?php else : ?> <?php x_featured_image(); ?> <?php endif; ?> </div> <?php endif; ?> <div class="entry-wrap"> <?php x_get_view( 'ethos', '_content', 'post-header' ); ?> <?php x_get_view( 'global', '_content' ); ?> <?php echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]'); ?> </div> <?php endif; ?> </article>
Hope it helps.
May 2, 2015 at 5:08 am #263715i tried again and everything seems alright except that anytime i edit the functions.php of the X-child theme and add the code the same thing happens all over again. screen just goes blank, nothing is showing.
May 2, 2015 at 5:14 am #263719ok so site is showing well now. where do i find framework? is this the correct path? /public_html/wp-content/themes/x/framework.
edit:: all is well now. share buttons shows up. However it is showing up in the index page and the post page. How can i set it to show only in the post page. Also if i want to remove so share buttons that i dont have social profile for, would i have to go to that content.php page and manually remove the code?
suggestion: i think themeco should make this easier. It should come as one of the extensions.
May 2, 2015 at 5:28 am #263726Hi There,
The /public_html/wp-content/themes/x/framework path is correct.
The Ethos views path is: /public_html/wp-content/themes/x/framework/views/ethos/
If you have any questions, don’t hesitate to ask.
Regards!August 25, 2015 at 1:56 am #368468I’ve got a question about this subject, I implemented the code for social shares, but I want it shown only on the single post page, but it shows on all pages. How can I achieve this?
August 25, 2015 at 2:03 am #368474Ah, I fixed it already, sorry for the bother!
August 25, 2015 at 2:11 am #368486Glad you sorted things out, Cheers!
October 20, 2015 at 8:28 am #632496Hi guys, your code worked just fine for me.
Can I add more social networks? Like github?October 20, 2015 at 9:02 am #632552Also would like the social just for posts not for pages
October 20, 2015 at 9:06 am #632561Hi there @mrk,
Thanks for writing in, additional social networks would require some customizations.
As the original here was resolved, can you start a new topic please about modifying the shortcode and having it just for posts and we’ll be right along to assist.
Thanks for your understanding.
-
AuthorPosts