Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Custom link in RSS box (http://forum.bytesforall.com/showthread.php?t=6512)

Plainzero Mar 29, 2010 01:06 PM

Custom link in RSS box
 
Hello all, first off I'd like to say thanks to the good people here who have been most helpful with my previous questions with Atahualpa. I have one last question that I'm hoping has an easy solution, my client would like to place a twitter image link alongside the RSS feed and Comment buttons, can anyone point me in the right direction?

WP Version: 2.9.1
ATA Version: 3.4.5

juggledad Apr 3, 2010 04:54 AM

you will need to add some code into bfa_header_config.php

hexink Apr 3, 2010 10:36 PM

If you (or any visitor running a search) are looking for specifics - I worked it out despite not knowing much PHP. There are two steps, and remember that until they add these features you'll have to re-do this every time the theme updates. I added links for Twitter, Facebook, myspace, and LinkedIn to my site in this manner, so those are the codes I'm including. You'll also need appropriate images for the link icons, but most of these came preloaded with the theme anyway.

First, edit your CSS. Add the following CSS code (I put it in css.php but you should be able to do it using CSS includes as well.)

Code:

/*-------------------- TWITTER FEED ICON --------------------*/

a.twitter-icon {
        height: 22px;
        line-height: 22px;
        margin: 0 5px 0 0;
        padding-left: 20px;
        display: block;
        text-decoration: none;
        float: right;
        white-space: nowrap;
        }

a.twitter-icon:link,
a.twitter-icon:active,
a.twitter-icon:visited {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/twitter-gray.png) no-repeat scroll center left;
}

a.twitter-icon:hover {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/twitter.png) no-repeat scroll center left;
}

/*-------------------- FACEBOOK FEED ICON --------------------*/

a.facebook-icon {
        height: 22px;
        line-height: 22px;
        margin: 0 5px 0 0;
        padding-left: 20px;
        display: block;
        text-decoration: none;
        float: right;
        white-space: nowrap;
        }

a.facebook-icon:link,
a.facebook-icon:active,
a.facebook-icon:visited {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/facebook-gray.png) no-repeat scroll center left;
}

a.facebook-icon:hover {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/facebook.png) no-repeat scroll center left;
}

/*-------------------- LINKEDIN FEED ICON --------------------*/

a.linkedin-icon {
        height: 22px;
        line-height: 22px;
        margin: 0 5px 0 0;
        padding-left: 20px;
        display: block;
        text-decoration: none;
        float: right;
        white-space: nowrap;
        }

a.linkedin-icon:link,
a.linkedin-icon:active,
a.linkedin-icon:visited {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/linkedin-gray.png) no-repeat scroll center left;
}

a.linkedin-icon:hover {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/linkedin.png) no-repeat scroll center left;
}

/*-------------------- MYSPACE FEED ICON --------------------*/

a.myspace-icon {
        height: 22px;
        line-height: 22px;
        margin: 0 5px 0 0;
        padding-left: 20px;
        display: block;
        text-decoration: none;
        float: right;
        white-space: nowrap;
        }

a.myspace-icon:link,
a.myspace-icon:active,
a.myspace-icon:visited {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/myspace-gray.png) no-repeat scroll center left;
}

a.myspace-icon:hover {
        background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/myspace.png) no-repeat scroll center left;
}

Next, you need to edit the bfa_header_config.php file to add the links in question. Add the following code, but see the caveat below:

Code:

                //LINKEDIN Feed link
                if ( $bfa_ata['show_posts_icon'] == "Yes" ) {
                       
                        $logo_area .= '<a class="linkedin-icon" ';
                        $logo_area .= 'href="http://www.linkedin.com/in/yourpage" title="sometext">' . '</a>';
                       
                }

                //MYSPACE Feed link
                if ( $bfa_ata['show_posts_icon'] == "Yes" ) {
                       
                        $logo_area .= '<a class="myspace-icon" ';
                        $logo_area .= 'href="http://www.myspace.com/yourpage" title="sometext">' . '</a>';
                       
                }

                //FACEBOOK Feed link
                if ( $bfa_ata['show_posts_icon'] == "Yes" ) {
                       
                        $logo_area .= '<a class="facebook-icon" ';
                        $logo_area .= 'href="http://www.facebook.com/yourpage" title="sometext">' . '</a>';
                       
                }

                //TWITTER Feed link
                if ( $bfa_ata['show_posts_icon'] == "Yes" ) {
                       
                        $logo_area .= '<a class="twitter-icon" ';
                        $logo_area .= 'href="http://twitter.com/yourpage" title="sometext">' . '</a>';
                       
                }

Caveat: Because I didn't want any text, just the icons, the PHP code above doesn't include link text.

You can see how this was implemented on my site here: http://hexink.com

I'm an artist, so coming up with the most elegant solution may well be beyond me. This seems to work just fine, though, for the time being.

ColoradoGirl May 26, 2010 10:10 PM

1 Attachment(s)
Hello!
I am having trouble executing this code example. None of the additional buttons are showing up. My Atahualpa theme currently has Posts, Comment, and Email feeds. I'd like to include Facebook and Twitter, but I'm unsure where I'm messing up. The code in my bfa_header_config.php" file is attached. Can someone help me format this section? Thanks so much!

juggledad May 27, 2010 04:00 AM

ColoradoGirl
it looks like you did this in Word is that correct? you never want to edit code with Word, you want a text editor. Word has this (nasty) habit of putting in all sorts of formatting code around the text which does not help. So use a text editor and always save teh file as text (on the Mac 'TextWrangler' is a great free editor)

so start with that and try again - because of the formatting issue, I can't ever begin to figure out you may have done.

What is your version of Atahualpa and wp?
What is the url?

imwiththebandlq May 31, 2010 02:49 PM

Thanks so much for the code hexink! I've also been trying to figure this out. I've added the codes above to my css.php and bfa_header_config.php, but my links are also not showing up in the header. Is there something else I need to add?

thalo Jul 27, 2010 01:03 PM

so if you use the code from hexink, is there any specific place that it goes within each php file, or can you just stick it at the end of the file and be good?

thalo Jul 27, 2010 03:55 PM

i have got myself into some trouble now. I opened the css.php file in wordpad. I copied and pasted just the linkedin code and pasted it into the file just after the comments feed icon code. after i replaced the file (ftp) into the atahualpa folder and refreshed my page it came up completely blank. i deleted the code and updated the file with no change, still white.

what might i have done, what do i need to do to revert?
cheers.

juggledad Jul 28, 2010 03:19 AM

Down load and unzipped a fresh copy of the theme, them upload and replace the CSS.php.
That should get you back to the start. Then if you need to add CSS, put it in the CSS Inserts option
Do you have a caching plugin active?

thalo Jul 28, 2010 10:33 AM

thanks for the reply. I reinstalled the theme and it came out okay.

as far as CSS Inserts, just copy/past the code into the window? does that include the bfa_header_config.php code?

I dont have any plugins installed/active yet. any suggestions for a good caching plugin? i am really new to all this so thanks for your help.

juggledad Jul 29, 2010 04:49 AM

Quote:

as far as CSS Inserts, just copy/past the code into the window? does that include the bfa_header_config.php code?
you only put CSS in the CSS Inserts area - you shouldn't have to change or copy code from bfa_header_config.php

tlck9 Aug 12, 2010 05:00 AM

Atahualpa 3.4.9
version 3.0.1

I have updated the css.php file with the following, placing it between the POSTS FEED ICON & EMAIL SUBSCRIBE ICON code

/*-------------------- TWITTER FEED ICON --------------------*/

a.twitter-icon {
height: 22px;
line-height: 22px;
margin: 0 5px 0 0;
padding-left: 20px;
display: block;
text-decoration: none;
float: right;
white-space: nowrap;
}

a.twitter-icon:link,
a.twitter-icon:active,
a.twitter-icon:visited {
background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/twitter-gray.png) no-repeat scroll center left;
}

a.twitter-icon:hover {
background: transparent url(<?php echo $bfa_ata['template_directory']; ?>/images/twitter.png) no-repeat scroll center left;
}


I have placed the following into the bfa_header_config.php between the // COMMENT Feed link & the // Feedburner Email link

//TWITTER Feed link
if ( $bfa_ata['show_posts_icon'] == "Yes" ) {

$logo_area .= '<a class="twitter-icon" ';
$logo_area .= 'href="http://twitter.com/kustominteriors" title="find me on twitter">' . '</a>';

}

Nothing is showing up, so I must have followed the instructions incorrectly, or is there something I must click or turn on for it to work

my url is www.kustominteriors.co.uk/wordpress


All times are GMT -6. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.