Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created December 8, 2017 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/1e814c0c0852eda1633b71e49623b68d to your computer and use it in GitHub Desktop.
Save hellofromtonya/1e814c0c0852eda1633b71e49623b68d to your computer and use it in GitHub Desktop.
Change `>>` to `...` after "Continue reading" in the Beans framework
<?php
/**
* This line of code removes the >> HTML markup, meaning this HTML will not be sent out to the browser:
*
* <i class="uk-icon-angle-double-right uk-margin-small-left" data-markup-id="beans_next_icon[_more_link]"></i>
*/
beans_remove_markup('beans_next_icon[_more_link]');
/**
* Next, we register our callback to the "beans_post_more_link_text_output" filter. This gives us a
* "hook" to change the text. We can then append our "..." after the "Continue reading" text.
*/
beans_add_filter('beans_post_more_link_text_output', 'add_dots_after_continue_reading' );
/**
* Add ... after the "Continue reading" text.
*
* @since 1.0.0
*
* @param string $continue_reading_text "Continue reading" textual string.
*
* @return string
*/
function add_dots_after_continue_reading($continue_reading_text) {
return $continue_reading_text . '...';
}
@hellofromtonya
Copy link
Author

As a note, you can also use add_filter instead of beans_add_filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment