Jump to content


Photo
- - - - -

Adding CSS Button as read-more link

readmore more css button

Best Answer James B , 26 June 2013 - 07:48 PM

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;
}
Go to the full post


  • Please log in to reply
19 replies to this topic

#1 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 05:19 AM

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 

Please Login or Register to see this Hidden Content

). 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 :-(



#2 batman

batman

    Bat Learning

  • Members

  • 2085 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 25 June 2013 - 09:34 AM

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: @

Please Login or Register to see this Hidden Content

;
  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: @

Please Login or Register to see this Hidden Content

;
text-decoration: none;
background-color: darken(@

Please Login or Register to see this Hidden Content

, 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 

Please Login or Register to see this Hidden Content

 
If you need more CSS help, make sure you've downloaded Firebug for Firefox
and check out W3 Schools for more info. 

Please Login or Register to see this Hidden Content



#3 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 10:18 AM

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... ?



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 June 2013 - 04:45 PM

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



#5 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 04:57 PM

Ah ok.. well, the site in Question is

Please Login or Register to see this Hidden Content

. 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... 



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 June 2013 - 05:24 PM

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:

Please Login or Register to see this Hidden Content



#7 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 05:33 PM

I've added the CSS in the "custom CSS" section and pointed the URL to 

Please Login or Register to see this Hidden Content

- the URL is correct... but no button (bgimage) appears? screenshot.png



#8 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 June 2013 - 06:40 PM

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



#9 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 06:46 PM

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



#10 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 25 June 2013 - 08:22 PM

Hi there

 

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

 

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


#11 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 25 June 2013 - 08:28 PM

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



#12 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 25 June 2013 - 10:07 PM

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.



#13 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 26 June 2013 - 02:08 PM

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?



#14 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 26 June 2013 - 07:48 PM   Best Answer

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;
}


#15 touchtalk

touchtalk

    Member

  • Members
  • 17 posts
  • LocationVienna, Linz, Innsbruck
  • Country: Country Flag

Posted 27 June 2013 - 05:22 AM

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!!



#16 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 27 June 2013 - 07:31 PM

Thanks for your patience as well.



#17 tamarpostma

tamarpostma

    Advanced Member

  • Members
  • 44 posts
  • Framework Version:the latest!
  • Country: Country Flag

Posted 07 November 2013 - 09:35 AM

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?



#18 Danny

Danny

    Is Awesome!

  • Moderators
  • 15848 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 07 November 2013 - 12:12 PM

@

Please Login or Register to see this Hidden Content

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



#19 tamarpostma

tamarpostma

    Advanced Member

  • Members
  • 44 posts
  • Framework Version:the latest!
  • Country: Country Flag

Posted 08 November 2013 - 08:56 AM

Hi Danny,

 

It is in the feature slider, slide 2:

Please Login or Register to see this Hidden Content

 

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.



#20 Danny

Danny

    Is Awesome!

  • Moderators
  • 15848 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 08 November 2013 - 01:36 PM

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







Also tagged with one or more of these keywords: readmore, more, css, button