WordPress.org

Ready to get started?Download WordPress

Forums

Categories Help (14 posts)

  1. Jayesh87
    Member
    Posted 3 years 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

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    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]

  3. Jayesh87
    Member
    Posted 3 years ago #

    Cheers for the reply, how do i edit the category template file?
    Sorry i am new to all of this..

    Cheers,
    Jay

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Try looking for category.php in Appearance->Editor.

  5. Jayesh87
    Member
    Posted 3 years 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

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    In that case you need to edit index.php (Main Index Template).

  7. Jayesh87
    Member
    Posted 3 years 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'):?>

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    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;?>
  9. Jayesh87
    Member
    Posted 3 years 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/

  10. Jayesh87
    Member
    Posted 3 years 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....

  11. esmi
    Forum Moderator
    Posted 3 years ago #

    Sorry? I'm not sure what you're asking. I see the image on the right.

  12. Jayesh87
    Member
    Posted 3 years 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?

  13. Ross Cornell
    Member
    Posted 3 years 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>
  14. Jayesh87
    Member
    Posted 3 years ago #

    Cheers Ross that worked :)

Topic Closed

This topic has been closed to new replies.

About this Topic