• 0
Sign in to follow this  
Followers 0

Adding CSS Button as read-more link


Question

Posted · Report post

Hi guys,

I know there had been a topic in the past but unfortunately that didn't answer my question entirely.

 

I only know basics in CSS and nothing in PHP. 

 

I'd like to replace the "read more" text permanently by some CSS Button (like the ones generated with http://www.cssbuttongenerator.com/). Now, I don't know where to place the code this generator is giving me within the PHP files. 

 

I understand I'd need to both place the CSS in some file within my theme and also some code in another (PHP) file in order to point Pagelines to use the new code to display the button instead just the text.

 

Would be great if you had some tips how to resolve this as I didn't find any plugin or other info to resolve it myself :-(

Share this post


Link to post
Share on other sites

19 answers to this question

  • 0

Posted · Report post

Hi there, yes you can apply the button using css directly to the class or create your own.

 

.more-link {

    backgroundnone repeat scroll 0 0 blue;
    border1px solid black;
    border-radius5px 5px 5px 5px;
    padding5px;
    text-decorationnone;
}

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi touchtalk

 

You can try add in
PageLines > Site Options > Custom Code > CSS Rules
or in
Pagelines Customize (plugin)
(I copy my web button with CSS)
 
/*--Button read-more--*/
#page a.continue_reading_link {
  display: inline-block;
  .ie7-inline-block();
  padding: 4px 10px 4px;
  margin-bottom: 0; // For input.btn
  font-size: @buttonFontSize;
  font-family: @buttonFontFamily;
  line-height: 10px;
  color: white;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  vertical-align: middle;
  border: 1px solid @btnBorder;
  .border-radius(4px);
  @shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
  .box-shadow(@shadow);
  cursor: pointer;
  .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
font-size: 12px;
 
&:hover {  
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
@shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
color: white;
text-decoration: none;
background-color: darken(white, 10%);
border: 1px solid @btnBorder;}
 
&:active {
color: rgba(255,255,255,.75);}}
 
/*--adjust size text Button as read-more--*/
.continue_reading_link{font-size: 70%;}
 
My exemplary code is not necessarily applicable as written, to your site, so please adjust accordingly.
 
It is advisable to learn how to do this on your own too.  
Check out 
 
If you need more CSS help, make sure you've downloaded Firebug for Firefox
and check out W3 Schools for more info. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks a lot for your answer!

I've added the code to the CSS section. 

 

I'm assuming somewhere I'd need to tell pagelines to use this class when displaying the read-more link? Because right now it does not appear on the site... ?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

The classes Batman recommended should already exist.  May we have a link to your site?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Ah ok.. well, the site in Question is http://www.macmaniacs.at. I currently am using the text "WEITER LESEN...". But I feel I'd need a button, something more visible in order to keep users reading... 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Try

.a-more-link {

background-image:url('thefullURLfortheimage');

}

 

This will place a specific image behind the link. It doesn't replace the text.  That can be done in settings via Dashboard > PageLines > Site Options > Blog And Posts, which doubtlessly you know.

 

There's more info here on using background images: http://www.w3schools.com/css/css_background.asp

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I apologize.  Try .a.more-link instead of .a-more-link.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Unfortunately still no success. Tried it with both Safari and Chrome and also again reset cache...

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi there

 

You'll only need to apply the background to the .more-link class

 

.more-link {
    backgroundurl("your full url goes here") ;
}

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

OK, now this lead to loading the graphic; but it'd need more space around it as it's cut off...

 

I had replaced " by ' though.

 

screenshot1.png

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

You can adjust the padding/margin to position the text inside the image better and adjust the spacing.

 

example {padding: 10px;}

 

If you make the changes directly in firebug so you can get the positioning correct on the button, then you can copy/paste the entire correct code back into the framework.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I'll check on that later today; so far using "padding" looks quite promising. 

 

But isn't there a way to implement a real CSS button as a next step? If so, how?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

It worked! Now I managed to implement the CSS code and got a fine button. (you can see it at www.macmaniacs.at). CSS rocks.

 

Thanks so much for all the help and patience!!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for your patience as well.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hello,

 

I'm trying  to style my more-link too. But not having any luck with above code which I added to the custom css in pagelines customize.

What am I doing wrong?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

tamarpostma - Can you provide a link to where you have your more link please.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Danny,

 

It is in the feature slider, slide 2: http://i-english.nl/?page_id=3120

 

I've added some code i found here in the functions.php, but it's not taking. I tried btn-warning too, but to no avail.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

What code have you added to the functions.php file ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0