This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Filtering the ThemeBlvd Read More Arguments

  • Creator
    Topic
  • #24132
    srumery
    Participant

    I’ve been investigating a few issues related to the use of the <!--more--> tag. Here is what I found:

    I can’t get the “more” link to display at all unless I add this to the top of content.php in my child theme.

    global $more;
    $more = 0;

    Now I can see the link but I want to filter it. I found the themeblvd_the_content_more_args filter and I am using it like this:

    function rum_alter_themeblvd_read_more_link( $args ) {
    
    	$args['text']        = 'Read more ';
    	$args['color']       = 'slate_grey';
    	$args['icon_after']  = 'arrow-circle-o-right';
    
    	return $args;
    }
    add_filter( 'themeblvd_the_content_more_args', 'rum_alter_themeblvd_read_more_link' );

    After altering the global $more, the button displays and hides the content below it. However, pressing the button doesn’t seem to do anything.

    1) How can we get the button to unhide the content below the button?

    2) Is there a better way to alter the global $more so it works everywhere instead of dropping it in template files like content.php or content-page.php? … or, am I using this completely wrong?

    • This topic was modified 7 years, 6 months ago by srumery. Reason: spelling error in title
Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #24137
    Jason Bobich
    Keymaster

    Can you please post a live link to the issue so I can see it in context?

    #24140
    srumery
    Participant

    Here is a test site you can see it: http://sandbox.rumspeed.net/

    This sheds some light on it but maybe this use case isn’t how it should be used in the first place. The test post has a more tag inserted in it after the first sentence. The homepage is actually showing the default “Read More” button in the right place. The button works just fine but it isn’t’ getting filtered correctly.

    I removed the code resetting the $more global to 0 on content.php because I don’t believe that was helping anything.

    So, for now, can you check to see why the button on the homepage is not getting filtered?

    #24141
    srumery
    Participant

    Well… that didn’t really help at all because the button that is displaying is really the excerpt button, not the read more button. When I switch the theme over to Twenty Fifteen, the “Continue Reading” button appears and links directly to the post using where the read more tag is used (http://sandbox.rumspeed.net/testing-the-more-tag/#more-148). This isn’t working the same in Jump Start but maybe that is by design. Should the read more button be appearing on the homepage in the test post, or does the excerpt take over instead?

    This is a screenshot of the Twenty Fifteen homepage preview:
    http://screencast.com/t/fplve4mPx8t

    #24142
    Jason Bobich
    Keymaster

    In this example you’re linking me to, is the theme in its default state? Or have you added the global $more? I ask because you shouldn’t need to add this.

    #24156
    srumery
    Participant

    Yes. The theme is in the default state. It’s Jump Start v2.0.3 with a child theme with one function set to filter the arguments of the read more link.

    I was altering the global variable in a previous example but pulled it because it didn’t make sense.

    #24172
    Jason Bobich
    Keymaster

    Are you sure you actually set the blog posts to display full content, opposed to just the excerpts?

    Appearance > Theme Options > Content > Post Display: Blog > Excerpts of Full Content

    #24173
    srumery
    Participant

    Ah! I had not altered that setting. After changing it, it works as expected. The whole More tag business is a bit quirky. Sorry for wasting your time.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.