Graphene Themes Forum

Graphene Themes Forum

Community support for Graphene themes

  • Home
  • Register
    • Reset password
  • Contact Us

Home › Forums › Graphene WordPress theme › Support

how to add a facebook icon next to rss icon at the top of theme

  • istrategy

    October 26, 2010 at 12:41 am #11416

    Heres what i use (the src are just my own images you can use default ones just get default code from addthis.com):

    function graphene_social_icons(){

    ?>

    < a class=”addthis_button_twitter”>< /a>

    < a class=”addthis_button_facebook”>< /a>

    <?php

    }

    add_action(‘graphene_feed_icon’, ‘graphene_social_icons’);

    Remember tremove the spaces after each <

    The reason there are spaces is because otherwise it executes the code in these comments 🙂

    Anonymous

    October 26, 2010 at 2:52 am #11417

    getting this error when I try to use the above mentioned with my own css and functions.php in the child theme:

    Parse error: syntax error, unexpected ‘}’ in /home1/uglycars/public_html/libertythinkers/wp-content/themes/graphene_child_theme/functions.php on line 5

    my child theme style.css:

    Code:
    /*
    Theme Name: Graphene Child
    Theme URI: http: //example.com/
    Description: Child theme for the Graphene theme
    Author: Your name here
    Author URI: http: //example.com/about/
    Template: graphene
    Version: 0.1.0
    */
    @import url(“../graphene/style.css”);
    /* Your modification goes here */

    .slider_post_entry .addtoany_share_save_container
    {
    display:none;
    }

    .facebook_icon
    {
    background: url(“graphene/images/facebook.png”);
    width: 2em;
    }

    functions.php

    Code:
    function graphene_social_icons(){
    ?>
    < a class=”facebook_icon”>< /a>
    <?php
    }
    add_action(‘graphene_feed_icon’, ‘graphene_social_icons’);
    Admin

    Syahir Hakim

    October 26, 2010 at 5:54 am #11418

    Your functions.php file must have an initial opening <?php tag and a final closing ?> tag. Try this:

    <?php
    function graphene_social_icons(){ ?>
    <a class="facebook_icon"></a>
    <?php
    }
    add_action('graphene_feed_icon', 'graphene_social_icons');
    ?>
    Admin

    Syahir Hakim

    October 26, 2010 at 5:57 am #11419

    @Michael, if you put codes in between backticks (`) in your reply, the codes won’t be parsed.

    istrategy

    October 26, 2010 at 7:50 am #11420

    Thanks for the heads up Syahir!

    Anonymous

    October 26, 2010 at 1:49 pm #11421

    thanks all..I really appreciate you helping me out with my php noobness.

    dsol828

    November 20, 2010 at 11:13 am #11422

    Syahir,

    Need a little help with this one.

    I must explain off the bat, that my PHP knowledge is slim to none.

    I would like to add a facebook, twitter and youtube icon with links to respective sites right next to the RSS feed icon.

    Here is what I’ve done.

    functions.php

    <?php
    function graphene_social_icons(){ ?>
    <a class="facebook_icon"></a>
    <a class="twitter_icon"></a>
    <a class="youtube_icon"></a>
    <?php
    }
    add_action('graphene_feed_icon', 'graphene_social_icons');
    ?>

    style.css

    #facebook_icon a{
    margin:13px 0 0 13px;
    float:left;
    width:29px;
    height:29px;
    background:url(images/facebook.png) left top no-repeat;
    }
    #twitter_icon a{
    margin:13px 0 0 13px;
    float:left;
    width:29px;
    height:29px;
    background:url(images/twitter.png) left top no-repeat;
    }
    #youtube_icon a{
    margin:13px 0 0 13px;
    float:left;
    width:29px;
    height:29px;
    background:url(images/youtube.png) left top no-repeat;
    }

    header.php

    <div id="twitter_icon">
    <a href="http://www.twitter.com" title="Follow on Twitter" </a>
    </div>

    The twitter icon shows up perfectly with working link, but as soon as I add the facebook or youtube div in the header, I get multiples of each.

    I apologize in advance if this looks like a coding nightmare.

    I’ve been working on trial and error.

    And sorry for digging up a dead thread.

    Thanks in advance!

    dsol828

    November 21, 2010 at 2:32 am #11423

    I have also tried to follow what Andrew did.

    child function.php

    <?php
    function graphene_social_icons(){ ?>
    <a class="facebook_icon"></a>
    <?php
    }
    add_action('graphene_feed_icon', 'graphene_social_icons');
    ?>

    child style.css

    /*
    Theme Name: Graphene Child
    Theme URI: http: //example.com/
    Description: Child theme for the Graphene theme
    Author: Your name here
    Author URI: http: //example.com/about/
    Template: graphene
    Version: 0.1.0
    */
    @import url("../graphene/style.css");
    /* Your modification goes here */

    .slider_post_entry .addtoany_share_save_container
    {
    display:none;
    }

    .facebook_icon
    {
    background: url("graphene/images/facebook.png");
    width: 2em;
    }

    Nothing happens…

    Whats missing?

    Anonymous

    November 22, 2010 at 3:28 am #11424

    dsol,

    I have the facebook and twitter icon on my site which you can see here:

    http://libertythinkers.com/

    this is what I put in my child functions.php

    <?php
    function graphene_social_icons(){ ?>
    <a href="http://www.facebook.com/pages/Liberty-Thinkers/169018999777818" title="Join Liberty Thinkers on Facebook"><img src="http://yourlink.com" /></a>
    <a href="http://www.twitter.com/libertythinkers" title="Join Liberty Thinkers on Twitter"><img src="http://youlink.com" />
    </a>
    <?php
    }
    add_action('graphene_feed_icon','graphene_social_icons');
    ?>

    if you resize your icons to 29X29 and upload them into your child theme and then link to them, you shouldn’t need to use any css

    dsol828

    November 22, 2010 at 7:33 am #11425

    Thank you so much for the response Andrew. I was starting to think the thread was dead and ignored!

    I’ve tried your code in a child functions page but no success.

    I’m beginning to wonder if the issue isn’t with the graphene_feed_icon hook.

    A search of the original functions.php file for “graphene_feed_icon” returns absolutely nothing.

    Any ideas?

    Khairul?

Viewing 10 posts - 11 through 20 (of 39 total)

  • 1
  • 2
  • 3
  • 4
  • You must be logged in to reply to this topic.
Log In

Account

Log In
Register Lost Password

Search Forums

Priority Support

This free Support Forum relies on contributions from our support staffs and fellow Graphene themes users. While we endeavour to provide adequate and timely support, due to its voluntary nature responses are not guaranteed and may be delayed.

If you require urgent assistance, you may like to consider our Priority Support option.

Get Priority Support

Forums

  • Graphene WordPress theme
  • Graphene Mobile
  • Graphene Mobile Neo
  • Franz Josef

Recent Topics

  • The photo of my article is loading in the banner??
    12 months ago
  • need the original standard right sidebar back
    1 year ago
  • Hiding Child Listings only on Specific Pages?
    1 year ago
  • Is it possible to move the Comments counter?
    1 year ago
  • Image Size on Slider in home page
    1 year ago

Made with by Graphene Themes.