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.

Change text on "View Post" link

  • Creator
    Topic
  • #820
    tox
    Member

    I have watched the video and tried to figure out how to change the text on the “View Post” link on the list page, but I cannot figure out how. Please help me to explain how I shall write the code if I want the text to be “Read more” instead of “View Post” and where I shall put the snippet. I have managed to find this snippet in the theme-functions.php and I understand that this is where it should happen.

    // Text String Overwrites
    function swagger_frontend_locals( $locals ) {
    $locals[‘read_more’] = __( ‘View Post’, TB_GETTEXT_DOMAIN_FRONT );
    return $locals;
    }
    add_filter( ‘themeblvd_frontend_locals’, ‘swagger_frontend_locals’ );

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #828
    Jason Bobich
    Keymaster

    Hello,

    If you’re not a developer, you can use this plugin to change any of these text strings that the theme outputs on the frontend of the site:

    http://wordpress.org/extend/plugins/theme-blvd-string-swap

    Or, in this unique case since “Read More” happens to be the default framework text for that, you could simply remove Swagger’s filter from your Child theme’s functons.php to put it back to saying “Read More” —

    remove_filter( ‘themeblvd_frontend_locals’, ‘swagger_frontend_locals’ );

    Here’s a full breakdown on how these frontend text strings in the theme work and how they can be filtered: http://dev.themeblvd.com/tutorial/frontend-text-strings/ — (This is essentially what the string swap plugin does for you)

    #840
    tox
    Member

    Hello Jason,

    thank you for your fast reply and the suggestions. I have tried both methods and they work splendidly. But they also somehow overwrite the string translations that I have made with WPML. I did not tell you that I am building a multilingual site. Is there a way to put in some extra lines of code to make the Swedish version “Läs Mer” and the German version “Weiterlesen”? Now the code looks like this:

    function my_locals( $locals ) {
    $locals[‘read_more’] = ‘Read More’;
    return $locals;
    }
    add_filter( ‘themeblvd_frontend_locals’, ‘my_locals’ );

    And “Read More” is what I get in all three languages..

    Kind regards,

    Torkel

    #846
    Jason Bobich
    Keymaster

    I think in this case with using WPML, you’ll want to make sure there are no filters on theme’s text strings. So, this means you can’t use the String Swap plugin. And in your Child theme’s functions.php, you need to just remove the theme’s filter on the text string all together:

    remove_filter( ‘themeblvd_frontend_locals’, ‘swagger_frontend_locals’ );

    You shouldn’t need to do anything else, because as I said, the framework’s default is already “Read More” and the theme is changing it to “View Post” — So filtering the text to say “Read More” doesn’t really make sense; it’s not going to do anything except cause problems with WPML for no reason.

    #852
    tox
    Member

    When I try this solution the filter does not get removed. I can not understand why. Should there be any more code than the one line snippet you suggest? I am not a developer so please explain if there is something basic that I am misunderstanding.

    #859
    Jason Bobich
    Keymaster

    Are you using a Child theme? Are you using the sample Child theme that came with the theme? Where exactly are you putting that remove_filter line?

    That line should go after the framework is included in functions.php of your Child theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The forum ‘Swagger Responsive WordPress Theme’ is closed to new topics and replies.