Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi David,

    I hadn’t considered the possiblity of adding custom classes to the ‘Read More’ link. What I’ll do for you now, is push out a new release now with a custom filter to allow you to add custom classes to the button.

    It should take about 20 minutes, and I will post back here when I get the update pushed out and what code you’ll need to add to achieve what your after.

    Thanks!
    Evan

    Plugin Author Evan Herman

    (@eherman24)

    Hi David,

    I just release the 1.1.3.1 version, which adds two new features.

    The first is the custom class filter, which you have asked for.

    The other is the ability to alter the text of the ‘Read more’ button.

    Here is how you can achieve both ( Note: You’ll need to add the following to your active theme function.php file for things to take effect ) :

    Adding a Custom Class to the ‘Read more’ Button

    // add a custom class to the timeline express readmore link
    function timeline_express_custom_readmore_class( $button_classes ) {
        return $button_classes . 'custom-class-name';
    }
    add_filter( 'timeline-express-read-more-class' , 'timeline_express_custom_readmore_class' );

    Altering the ‘Read more’ text

    // alter 'Read more' to say 'View Announcement'
    function timeline_express_change_readmore_text( $translated_text, $untranslated_text, $domain ) {
        switch( $untranslated_text ) {
            case 'Read more':
              $translated_text = __( 'View Announcement','timeline-express' );
            break;
         }
       return $translated_text;
    }
    add_filter('gettext', 'timeline_express_change_readmore_text', 20, 3);

    Let me know if that helps you out!

    Thanks,
    Evan

    Thread Starter InternetMentor

    (@internetmentor)

    Hi Evan
    Many thanks for those changes, but the nature of the problem hasnt changed, I was manually adding my custom class to the 2 lines in the class.timeline-express.php file that included the “cd-read-more btn btn-primary” class’s.

    The passive, hover had the wrong shape but correct colours but the click state had the right shape and colours.

    If you see the https://gerri.internetmentor.uk/timeline/ youll see what I mean.
    Any thoughts
    David

    Plugin Author Evan Herman

    (@eherman24)

    First off,

    You shouldn’t be adding anything to the core files of the plugin. Each update is going to wipe out your changes.

    Second, I’m not 100% sure I understand your problem. If you’re referring to the issue of the button changing shape/color/size on click and hover that is actually directly related to your active themes style.css file and not with the plugin.

    You’ll need to make the changes to the style.css file of your active theme.

    Evan

    Thread Starter InternetMentor

    (@internetmentor)

    Hi Evan
    The style.css has a finish set of standard buttons fully defined as seen on other pages, and all that is need to style a single button is the class imbutton on its own.

    Adding the imbutton like you have kindly added does pull all the correct syles in, something is over ruled that stops the correct look to the button that is in the theme.

    I know this is not strictly your area of concern re your product, I could always code a specific css classes in my style.css file to cover Timeline express specifically.

    Thank you for your kind help on this though.

    Your thoughts?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change the Read More button on timeline to use the Template button’ is closed to new replies.