Move social buttons to top

Writer, blogging theme for writers and authors | Support forum.
GK User
Wed Feb 10, 2016 5:22 am
Hi!

How can I move the social buttons on post and pages to the top?
User avatar
Fresh Boarder

Joshua M
Wed Feb 10, 2016 9:55 am
Hi,

You have to move the following fragment from Writer/content-footer.php file:
Code: Select all
<?php if(is_singular() && get_theme_mod('writer_'.(is_page() ? 'page' : 'post').'_social_icons', '1') == '1') : ?>
        <?php do_action('writer_before_social_icons'); ?>
        <div class="entry-social-sharing">
            <?php do_action('writer_before_twitter_icon'); ?>

            <div class="entry-twitter-button">
                <a href="https://twitter.com/share" class="twitter-share-button" data-count="vertical">Tweet</a>
                <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
            </div>

            <?php do_action('writer_after_twitter_icon'); ?>

            <div class="entry-facebook-button">
                <script type="text/javascript">
                    jQuery(window).load(function(){
                        var root = document.createElement('div');
                        root.id = 'fb-root';
                        jQuery('.entry-facebook-button')[0].appendChild(root);
                        (function(d, s, id) {
                            var js, fjs = d.getElementsByTagName(s)[0];
                            if (d.getElementById(id)) {return;}
                            js = d.createElement(s); js.id = id;
                            js.src = document.location.protocol + "//connect.facebook.net/en_US/all.js#xfbml=1";
                            fjs.parentNode.insertBefore(js, fjs);
                        }(document, 'script', 'facebook-jssdk'));
                    });
                </script>
                <div class="fb-like" data-width="150" data-layout="box_count" data-action="like" data-show-faces="false"></div>
            </div>

            <?php do_action('writer_after_fb_icon'); ?>

            <div class="entry-gplus-button">
                <div class="g-plusone" data-size="tall"></div>
                <?php
                  $lang = explode('-', get_bloginfo('language'));
               $lang = $lang[0];
               ?>
                <script type="text/javascript">
                window.___gcfg = {lang: '<?php echo $lang; ?>'};

                (function() {
                    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                    po.src = 'https://apis.google.com/js/platform.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                })();
                </script>
            </div>

            <?php do_action('writer_after_gplus_icon'); ?>
        </div>
        <?php do_action('writer_after_social_icons'); ?>
    <?php endif; ?>


into Writer/content-header.php file (at the end of this file)
It's recommended to use a Child theme instead of theme core files modifications.
User avatar
Moderator

GK User
Wed Feb 10, 2016 7:29 pm
Tnks!

But now the facebook button desapears and only shows the text login.
User avatar
Fresh Boarder

Joshua M
Thu Feb 11, 2016 9:09 am
It works properly on my installation, could you provide your site URL, where I can see the issue?
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.