Jump to content

Archived

This topic is now archived and is closed to further replies.

touchtalk

Adding CSS Button as read-more link

Recommended Posts

touchtalk    0
touchtalk

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
batman    389
batman

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. 

Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
Rob    547
Rob

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


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
Rob    547
Rob

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


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob    547
Rob

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


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
James B    436
James B

Hi there

 

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

 

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

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
James B    436
James B

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.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
James B    436
James B

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

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
touchtalk    0
touchtalk

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
Rob    547
Rob

Thanks for your patience as well.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
tamarpostma    0
tamarpostma

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
Danny    1,327
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
tamarpostma    0
tamarpostma

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
Danny    1,327
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys,
      every since Chrome introduce scroll anchoring (see chrome://flags) blog posts on my page start scroll automatically as soon as the user scrolls down a bit. It is super annoying and I don't know exactly what triggers the incompatibility with Chrome's latest feature that is supposed to improve usability.
      Since I don't know what causes it (Pagelines, or a Plugin), I would like to disable the feature using a CSS override that Google describes as follow:
      "Scroll anchoring aims to be the default mode of behavior when launched, so that users benefit from it even on legacy content. A CSS property overflow-anchor can disable scroll anchoring in part or all of a webpage (opt out), or exclude portions of the DOM from the anchor node selection algorithm. This property supports the following values when applied to an element E:
      overflow-anchor: auto (the default value) declares that the DOM subtree rooted at E is eligible to participate in the anchor node selection algorithm for any scrolling box created by E or an ancestor of E. overflow-anchor: none declares that the DOM subtree rooted at E is not eligible to participate in the anchor node selection algorithm for any scrolling box created by E or an ancestor of E." Do you guys happen to know how to use that property with the ROOT element so it applies to the whole page?
      Thanks
      Michael 
    • wyo22ski
      By wyo22ski+
      Hello,
       
      I'm basically a designer and understand a little on how to change CSS, etc., so please excuse my ignorance...  I recently upgraded to the newest platform from the DMS and my old DMS theme no longer functions.  I'm trying to replace the image slider that my Horizon Photography Theme (Nick Haskins) had created.  The Impulse image slider seemed the closest to what I need, but there are problems.
      It seems the the Impulse section for sliding images defaults to the image width, no the height.  I can change the Impulse stage height and width, but this does nothing to the internal content.  For instance, if I change the height to 200 pixels, the image remains the full width and only shows a cropped section.  I would like the ability to change the Impulse height, and have the image height fit space. 
      I've put this custom CSS in, but again, this only controls the stage height of Impulse:
      .pl-sn-impulse .pl-impulse-cell .cell-wrap, .pl-impulse-container, .owl-stage-outer {
        width: 100%;
      }
       
      Any suggestions welcome.  Thanks 
    • Objectif-Mariage
      By Objectif-Mariage+
      Hello. 
      I have just realized that CSS (Less plugin) , is not working..... I have disable all plugins (except PL CUSTOM LESS and PL5) , and ... it's not working ... 
      It's not the first time. Usually I had trouble with a plugin name Autoptimize , but it's Desactivate now , all memory have been purge, and it's still not working! :-/ So it's not from this plugin. 
      NB : When I am logged on my website, if i go on the black wordpress dashboard bar, go on the PL icon, clic on </> LESS/CSS => then the page suddenly apply the CSS .... But As soon that i reload the page, nothing. I think the problem is that the plugin LESS/CSS does not load properly (if I can say that with my simples words).
      I order to keep the site "good looking" I have temporally copy/paste all my LESS code in a plugin : Script n Styles that apply the LESS/CSS code... but it's not a solution for long time.
      Can someone help me ? Did I do something wrong ? Is it an update ? 
       
      my website : https://www.wedding-photography-minneapolis.com
    • Jason
      By Jason+
      Feel free to delete this post if its not helpful or its just plain wrong.
       
      I though it might be useful to share how I customize the size of the builder. (reduce my eyestrain )
      1 - install stylerbot extension in chrome (stylerbot keeps this css every time you access the url)
       
      2- add this css to stylerbot for the site you are working on
      .CodeMirror {
          font-size: 14px;
          height: 600px;
      }
      .pl-workarea.pl-has-sidebar .pl-workarea-sidebar-container {
          right: 0px;
          width: 500px;
      }
      .pl-workarea.pl-has-sidebar .iframe-container {
          right: 500px ;
      }
       
      change sizes to suit.
       
      Cheers.
    • Jason
      By Jason+
      Hi.
      I can't seem to get the Teamwork section to accept custom css. I am trying to change the padding from 7em to 1em on the splash part
      I have tried
        .pl-sn-teamwork .pl-tw-splash {
          padding-top: 1em;
          padding-bottom: 1em;
        }
       
      This works in chrome inspect but when added to custom css nothing happens.
      I have also tried most of the classes I can see accoiated with this section but again nothng seems to happen.
      Any ideas?
×