Skip to content

Instantly share code, notes, and snippets.

@AdelDima
Last active June 10, 2017 10:45
Show Gist options
  • Save AdelDima/4a59caaaa06362e84e26418d044e1e27 to your computer and use it in GitHub Desktop.
Save AdelDima/4a59caaaa06362e84e26418d044e1e27 to your computer and use it in GitHub Desktop.
functions Okab WordPress Theme
<?php
/**
* Add a Read More button
* @return string
*/
function prefix_blog_read_more_btn() {
$post = get_post( get_the_ID() );
$post = get_permalink( $post, false );
return "<a style=\"display: block; width: 120px; margin-top: 20px;\" class=\"dima-button dima-btn-no-rounded fill dima-btn-mini\" href=\"{$post}\">"
.esc_html__( 'Read More', 'okab' )
."</a>";
}
add_filter( 'dima_blog_read_more_excerpt', 'prefix_blog_read_more_btn' );
/**
* change the breadcrumb to say *Our Blog* instead of *Home*
* @return array
*/
function prefix_breadcrumbs_defaults(){
$_options = array(
'home_label' => esc_html__( 'Our Blog', 'okab' ),
'tag_archive_text' => esc_html__( 'Tag:', 'okab' ),
'search_text' => esc_html__( 'Search:', 'okab' ),
'error_text' => esc_html__( '404 - Page not Found', 'okab' ),
);
return $_options;
}
add_filter('dima_breadcrumbs_defaults','prefix_breadcrumbs_defaults' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment