Change View Full Post

  • raindance

    #1893

    I’ve read the post

    https://forum.graphene-theme.com/graphene-support/changing-view-full-post

    I’ve installed the Customization Localization plugin.

    But I have no idea after reading that post several times how to get started.

    Can you offer a more detailed/step by step assistance to get “View Full Post” text changed? I don’t need another language supported, I just want to change the text on that button to “Read More”

    Thanks

    Admin

    Syahir Hakim

    #17553

    raindance

    #17554

    Ok so to distill it…

    Would I add this to my child theme functions.php file and just change

    ‘Follow me on Twitter’ => ‘Follow my organisation on Twitter’,

    to

    ‘View Full Post’ => ‘Read More’, ??

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Follow me on Twitter' => 'Follow my organisation on Twitter',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    raindance

    #17555

    Ooops…well I added this to my child theme functions.php file:

    <?php
    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'View Full Post' => 'Read More',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );
    ?>

    But no dice. What did I do wrong 🙂

    Admin

    Syahir Hakim

    #17556

    Try View full post instead of View Full Post. It needs to be exactly like it appears in the theme’s code, with proper caps and all.

    raindance

    #17557

    Oh duh, yup that was it. Yeay! SO much easier than that whole localization thing…I was lost on that one.

    What else can be changed via this method? I mean what other things are coded in this way which can be adjusted here?

    Thanks!

    raindance

    #17558

    Hmmm…that worked but now when I go to the Graphene Options pane, to try to make the fb like button go to the right in that top row, and save, I get this error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/juicytrv/public_html/wp-content/themes/graphene-child/functions.php:68) in /home/juicytrv/public_html/wp-includes/pluggable.php on line 934

    I’ve gotten that before and it makes it so I can’t log in, have to disable my child theme functions.php file, log in, then re-enable it. Any idea what’s going on?

    This happened the other day and I couldn’t save anything…no posts, pages, changes in admin…nada.

    Admin

    Syahir Hakim

    #17559

    All of the theme’s text and labels that are wrapped in _e() or __() in the codes.

    Admin

    raindance

    #17561

    Here is my entire functions.php file, and line 68 is the closing tag. It’s not liking something…

    <?php
    function graphene_slider_post_types(){
    return array('post', 'page');
    }
    add_filter( 'graphene_slider_post_type', 'graphene_slider_post_types' );
    ?>
    <?php
    // attaches the function my_post_nav to the hook graphene_post_nav
    add_action ('graphene_after_post_content', 'my_post_nav');
    // our function
    function my_post_nav(){
    // this will allow us to use other hooks but still only show on single posts
    if ( is_single() && ! is_page() ) : ?>
    <div id="my-post-nav"> <!-- div to contain your links -->
    <?php previous_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?> |
    <?php next_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?>
    </div>
    <?php endif; ?>
    <?php } ?>
    <?php
    /******
    * these next two remove the graphene breadcrumb and then add one
    * which does not appear on the home page
    *****/

    // has to be called after the action is added
    add_action ('after_setup_theme', 'wmrt_remove_graphene_bc');
    function wmrt_remove_graphene_bc() {
    remove_action ('graphene_top_content', 'graphene_breadcrumb_navxt');
    }

    add_action('graphene_top_content', 'wmrt_breadcrumb_navxt');
    function wmrt_breadcrumb_navxt () {
    //by calling this at this point is_home() works!
    if ((function_exists('bcn_display')) && (!(is_front_page()))) {
    echo '<div class="breadcrumb">';
    bcn_display();
    echo '</div>';
    }
    }
    ?>
    <?php
    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'View full post' => 'Read More',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );
    ?>

    Did I do the tags wrong?

Viewing 10 posts - 1 through 10 (of 32 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!