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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thanks for your patience as well.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
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

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

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

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

    • oseehys
      By oseehys+
      Of all the Items that is on Pagelines Shortcode, the Signup on the Settings page is the biggest miss, can anybody tell me how i can add the Signup Shortcode on a link my footer so that users can subscribe to my blog directly or better still to create the shortcode myself if thats possible, but instead of adding a new button somewhere down, i think its better to add the Signup shortcode to an existing link, Thanks
    • chamois_blanc
      By chamois_blanc+
      Hello,
      Shouldn't the image PL5 component be using the srcset/picture css directives to pick the correct size for an image? or it does already and I don't know how to use it? Thank you for any advice or enlightenment.
    • Dan Haddock
      By Dan Haddock
      Plugins Active and installed: 
      Akismet Anti-Spam
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools  
      Enhanced Media Library  
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap
      Jetpack by WordPress.com
      Legull 
      Loginizer   
      MailChimp for WordPress
      PageLines Updater    
      Schema App Structured Data 
      Sucuri Security - Auditing, Malware Scanner and Hardening
      Uber reCaptcha    
      Yoast SEO
      Wordpress Version: 4.8.1
      Pagelines Version: 2.2.4
       
      Good Evening/Afternoon or Morning, 
      I am running into a problem with CSS styling not applying inside of most browsers (Safari, Firefox) when I am logged in to wordpress, and all browsers that I have tested when I am logged off and the site has been made public (Chrome, Firefox and Safari).
      As a result, I have managed to identify the probable cause. It looks as though these browsers are refusing to render my sites compiled CSS file due to it being a HTTP URL rather than HTTPS.
      I have attempted to change this URL to HTTPS in my browser, however it brings back an ERROR: File not found page - https://www.shortfilmblog.com/wp-content/uploads/pagelines/compiled-css-core-1505847507.css
      What would you suggest in this regard? Would this be resolvable from your end?
      Happy to provide any further details required.
    • Borries
      By Borries+
      I know this is not an easy problem. Maybe there is a easy solution.
      I have tryed to uses the existing solution, that I have found in the forum
      I changed the colours of my nav (simple nav) and the hover effect (a. hover).
      I really tryed to highlight the active/used link in the nav but I cant figure it out.
      I want it to be black when active.
      Any help would be appreciated. Thanks.
      http://www.marcborries.de  nav link: "Sinn & Selbst" 
    • 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 
×