%s', get_permalink($post->ID), __('Read More', 'agama'));
}
return;
}
/**
* Add Class to Post Edit Link
*
* @since 1.1.1
*/
function edit_post_link( $output ) {
$output = str_replace('class="post-edit-link"', 'class="button button-3d button-mini button-rounded"', $output);
return $output;
}
/**
* Add Class to Post Edit Comment Link
*
* @since 1.1.1
*/
function edit_comment_link( $output ) {
$output = str_replace('class="comment-edit-link"', 'class="button button-3d button-mini button-rounded"', $output);
return $output;
}
/**
* Render Menu Content
*
* @since 1.1.1
*/
public static function menu( $location = false, $class = false ) {
// If location not set
if( ! $location ) {
return;
}
$args = array(
'theme_location' => $location,
'menu_class' => $class,
'container' => false,
'echo' => '0'
);
$menu = wp_nav_menu( $args );
return $menu;
}
/**
* Social Icons
*
* Display social icons.
*
* @param string $tip_position (optional) The position of tooltip.
* @param string $style (optional) The social icons style name.
*
* @since 1.1.1
* @since 1.4.2 Updated the code.
* @access public
* @return mixed
*/
public static function social_icons( $tip_position = null, $style = null ) {
$settings = get_theme_mod( 'agama_social_icons', [
[
'target' => '',
'icon' => 'rss',
'url' => esc_url_raw( get_bloginfo('rss2_url') )
]
]);
if( $settings && is_array( $settings ) ) {
if( 'animated' == $style ) echo '';
foreach( $settings as $setting ) {
if( 'animated' == $style ) echo '- ';
// Format VK and RSS icon names.
if( 'rss' == $setting['icon'] || 'vk' == $setting['icon'] ) {
$title = strtoupper( $setting['icon'] );
}
else // Format StackOverflow icon name.
if( 'stack-overflow' == $setting['icon'] ) {
$title = str_replace( '-', '', $setting['icon'] );
$title = ucfirst( $title );
} else {
$title = ucfirst( $setting['icon'] );
}
// Format url data.
$data = 'title="'. esc_html( $title ) .'"';
if( 'animated' !== $style ) {
$data .= ' data-toggle="tooltip"';
if( $tip_position ) {
$data .= ' data-placement="'. esc_attr( $tip_position ) .'"';
}
}
// Format url target.
if( $setting['target'] ) {
$target = 'target="_blank"';
} else {
$target = 'target="_self"';
}
// Format url class name.
'animated' == $style ? $class = 'tv-' . strtolower( $setting['icon'] ) : $class = 'social-icons ' . strtolower( $setting['icon'] );
// Format fontawesome class name.
$fontawesome = 'fa-' . strtolower( $setting['icon'] );
// Format fontawesome email icon class.
if( 'email' == $setting['icon'] ) {
$fontawesome = 'fa-at';
}
// Format email url.
if( 'email' == $setting['icon'] ) {
$setting['url'] = 'mailto:'. esc_attr( $setting['url'] );
}
else
// Format phone url.
if( 'phone' == $setting['icon'] ) {
$setting['url'] = 'tel:'. esc_attr( $setting['url'] );
}
else
// Format skype url.
if( 'skype' == $setting['icon'] ) {
$setting['url'] = 'skype:'. esc_attr( $setting['url'] ) .'?call';
} else { // Escape all other urls.
$setting['url'] = esc_url( $setting['url'] );
}
echo '';
if( 'animated' == $style ) echo '';
if( 'animated' == $style ) echo ''. esc_html( $title ) .'';
echo '';
if( 'animated' == $style ) echo '
';
}
if( 'animated' == $style ) echo '
';
}
}
/**
* Get Post Format
*
* @since 1.1.1
*/
public static function post_format() {
$post_format = get_post_format();
switch( $post_format ) {
case 'aside':
$icon = '';
break;
case 'chat':
$icon = '';
break;
case 'gallery':
$icon = '';
break;
case 'link':
$icon = '';
break;
case 'image':
$icon = '';
break;
case 'quote':
$icon = '';
break;
case 'status':
$icon = '';
break;
case 'video':
$icon = '';
break;
case 'audio':
$icon = '';
break;
default: $icon = '';
}
return $icon;
}
/**
* Count Comments
*
* @since 1.1.1
*/
public static function comments_count() {
$comments = 0;
if( comments_open() ) {
$comments = sprintf('%s', get_comments_link(), get_comments_number() . __( ' comments', 'agama' ) );
}
return $comments;
}
/**
* Next | Previous - Post Links
*
* @since 1.0.0
*/
public static function post_prev_next_links() {
if( get_previous_post_link() || get_next_post_link() ) { ?>