Jayesh87
Member
Posted 1 year ago #
Hi All,
I need to add the following code:
<a href="http://www.walkon.com" title="Liverpool News"><img src="http://www.affinitymediagroup.com/football_news_logos/liverpool_news.gif" alt="Liverpool News" width="120" height="45" border="0" /></a>
To this page on my blog (only this page) and it is a category not a page:
http://www.lfcismyreligion.com/category/lfc-news/
Ideally i want the page to look like this:
http://i227.photobucket.com/albums/dd271/Jayesh1987/BlogNews.jpg
(the code adds the ‘As featured on WalkOn.com’ image bit…)
I want it to go above the news posts on the right hand side (as i put it on my dodgy photoshop job!)
If i had to have it on all categories pages then that wouldn't be the end of the world...
Is this possible?
Help please :)
Cheers,
Jay
Try editing your theme's category template file (category.php?) and adding:
<?php if( is_category( 'lfc-news') ):?>
<a href="http://www.walkon.com" title="Liverpool News"><img src="http://www.affinitymediagroup.com/football_news_logos/liverpool_news.gif" alt="Liverpool News" width="120" height="45" /></a>
<?php endif;?>
[EDITED]
Jayesh87
Member
Posted 1 year ago #
Cheers for the reply, how do i edit the category template file?
Sorry i am new to all of this..
Cheers,
Jay
Try looking for category.php in Appearance->Editor.
Jayesh87
Member
Posted 1 year ago #
I don't have a category.php file
just the ones shown in this screenshot:
http://i227.photobucket.com/albums/dd271/Jayesh1987/Capture-1.jpg
In that case you need to edit index.php (Main Index Template).
Jayesh87
Member
Posted 1 year ago #
I get this error message:
Parse error: syntax error, unexpected ':' in /var/sites/l/lfcismyreligion.com/public_html/wp-content/themes/fastblog/index.php on line 48
which refers to this line:
<?php if( is_category( 'lfc-news'):?>
Sorry - I missed a bracket:
<?php if( is_category( 'lfc-news') ):?>
<a href="http://www.walkon.com" title="Liverpool News"><img src="http://www.affinitymediagroup.com/football_news_logos/liverpool_news.gif" alt="Liverpool News" width="120" height="45" /></a>
<?php endif;?>
Jayesh87
Member
Posted 1 year ago #
Cheers mate that worked a treat!!
Sorry one last question...
Do you know how i can it on the right hand side of the page as it is currently on the left?
http://www.lfcismyreligion.com/category/lfc-news/
Jayesh87
Member
Posted 1 year ago #
I tried:
<?php if( is_category( 'lfc-news') ):?>
<div class="alignright"
<a href="http://www.walkon.com" title="Liverpool News"><img src="http://www.affinitymediagroup.com/football_news_logos/liverpool_news.gif" alt="Liverpool News" width="120" height="45" /></a> </div>
<?php endif;?>
but as you can see: http://www.lfcismyreligion.com/category/lfc-news/
the image is ovelapped by the posts....
Sorry? I'm not sure what you're asking. I see the image on the right.
Jayesh87
Member
Posted 1 year ago #
When i don't use:
<div class="alignright"
</div>
In the code, the page looks like this:
http://i227.photobucket.com/albums/dd271/Jayesh1987/left.jpg
but if i do use the code above, it looks like this:
http://i227.photobucket.com/albums/dd271/Jayesh1987/Overlap.jpg
as you can see the 'post' overlaps onto the image (it also does this if i align to the left or center)
I want the image on the right hand side but not to be overlapped by the post...
Hope that makes more sense?
Ross Cornell
Member
Posted 1 year ago #
Looks like you're floating the div so everything else is trying to wrap around it.
There are a few ways you could fix this. If you can edit the stylesheet then you could use a clearfix on the div and float the image inside it. If not, then I guess the quick and dirty way would be to put:
<div style="clear:both;"></div>
after
<div class="alignright">
</div>
Jayesh87
Member
Posted 1 year ago #
Cheers Ross that worked :)