Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member Liam Kenneth's Avatar
    Join Date
    Mar 2011
    Location
    London, United Kingdom
    Posts
    9
    Member #
    27123
    Hi all Im having a problem as you can guess I cant style the more link in WordPress this is the code

    Code:
    <div class="entry">
    				<div id="Readmore"><?php the_content('Read More'); ?></div>	</div>
    At the moment it displays as a text url but I wanted it to be a image
    I applied a Background image to it but it doesnt work instead it sets the BG image to the actual blog post so for each one there is my button. so scrapped that idea and just did
    Code:
     #Readmore {color: blue;}
    now all the text in my posts are blue and the read more tag is not effected so how do I use a ID or class to style the more tag with out effecting my blog posts?

    Thanks I hope that all made sense

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2784 times
    That usually means that your readmore div isn't closed properly, but I can't see that being the case (or your whole layout would be messed).

    But if you want your link to be blue, do this:
    Code:
    div#Readmore a {color:  blue;}
    That will change the link.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    Code:
    #Readmore {color: blue; background: url (readmore_image.jpg);}

  5. #4
    Junior Member Liam Kenneth's Avatar
    Join Date
    Mar 2011
    Location
    London, United Kingdom
    Posts
    9
    Member #
    27123
    Oh DUH! Thanks for pointing that out. I weren't selecting the a tag lol I have my background image now just need to find out how to remove the text in a SEO friendly way. with a normal a tag you can just take out the words but with this function
    Code:
    <div id="Readmore"><?php the_content('Read More'); ?></div>
    im not sure if its possible.

    I could try a BG Image with no text and just use the link text. Im so tired I think I will do this tomorrow. Thanks for your help

  6. #5
    Member michelledancer's Avatar
    Join Date
    Feb 2011
    Location
    Newcastle upon Tyne
    Posts
    41
    Member #
    26906
    Liked
    9 times
    The reason your image and link colours were affecting the whole post is because your #readmore div is surrounding the whole post

    PHP Code:
    <?php the_content(); ?>
    prints out the content of a post, and the 'read more' is just your custom text for the read more link on the end of that content.

    To style just the read more link, check the source code being outputted. The link should have its own class ("more-link" or something, I believe) which you can then target to do everything you want.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com