__( 'Primary Menu', 'coeur' ),
) );
register_nav_menus( array(
'mobile' => __( 'Mobile menu', 'coeur' ),
) );
// Add Post Formats
add_theme_support('post-formats', array(
'quote',
'image',
'chat'
));
// HTML5 Support
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
// Content Width
if(!isset($content_width)) $content_width = 908;
}
add_action( 'after_setup_theme', 'coeur_setup' );
// Page Title
function coeur_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() ) {
return $title;
}
// Add the site name.
$title .= get_bloginfo( 'name', 'display' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 ) {
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'coeur_wp_title', 10, 2 );
// Sidebar & Widget Registration
function coeur_widgets_init() {
register_sidebar( array(
'name' => __( 'Primary Sidebar', 'coeur' ),
'id' => 'sidebar-1',
'description' => __( 'Main sidebar that appears on the right.', 'coeur' ),
'before_widget' => '',
'before_title' => '
',
));
}
add_action('widgets_init', 'coeur_widgets_init');
// Paging
function coeur_paging( $query=null ) {
global $wp_query;
$query = $query ? $query : $wp_query;
$big = 999999999;
$paginate = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'type' => 'array',
'total' => $query->max_num_pages,
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'prev_text' => __('«', 'coeur'),
'next_text' => __('»', 'coeur'),
)
);
if ($query->max_num_pages > 1) :
?>
ID;
$coeur_thepost= get_post($id= $coeur_the_id);
$coeur_comment_count = $coeur_thepost->comment_count;
echo '';
}
function coeur_previousPost() {
$coeur_prev_post = get_previous_post();
if(!empty($coeur_prev_post)){
echo '';
}
}
function coeur_nextPost() {
$coeur_next_post = get_next_post();
if(!empty($coeur_next_post)){
echo '';
}
}
function coeur_authorLink(){
global $post;
$coeur_author_id = $post->post_author;
$coeur_author_name = get_the_author_meta( 'display_name', $coeur_author_id );
$coeur_author_name = ucfirst($coeur_author_name);
$coeur_author_url = get_author_posts_url( $post->post_author );
echo '';
}
/**
* Shows post author link if set to in settings
* @author Frenchtastic
* @since Coeur 1.7
*/
function coeur_author(){
global $post;
$coeur_author_id = $post->post_author;
$coeur_author_name = get_the_author_meta( 'display_name', $coeur_author_id );
$coeur_author_name = ucfirst($coeur_author_name);
$coeur_author_url = get_author_posts_url( $post->post_author );
if (get_theme_mod( 'coeur_show_author' ) == '1'){
echo __('by', 'coeur'), ' '.$coeur_author_name.'';
}
}
/**
* Changes text preceding the post date
* @author Frenchtastic
* @since Coeur 1.7
*/
function coeur_post_date(){
$coeur_meta = get_option('coeur_meta_posted');
if (empty($coeur_meta)){
echo __('Posted on', 'coeur');
} else {
return esc_html_e(get_option('coeur_meta_posted'));
}
}
/**
* Displays categories if set to do so in settings
* @author Frenchtastic
* @since Coeur 1.7
*/
function coeur_cat(){
global $post;
$categories = get_the_category($post->ID);
$separator = ', ';
$output = '';
if($categories && get_theme_mod( 'coeur_show_cat' ) == '1'){
foreach($categories as $category) {
$output .= ''. _e('in','coeur').' '.$category->cat_name.''.$separator;
}
echo trim($output, $separator);
}
}
function coeur_footer(){
$coeur_footer = get_option('coeur_footer_copyright');
if(empty($coeur_footer)){
echo 'Design by Frenchtastic.eu';
} else {
echo get_option('coeur_footer_copyright');
}
}
/**
* Excerpt length
* @since Coeur 1.0
*/
function coeur_excerpt_length( $length ) {
return 73;
}
add_filter( 'excerpt_length', 'coeur_excerpt_length', 999 );
/**
* Read more link
* @since Coeur 1.0
*/
function coeur_read_more( $more ) {
return '.. '.__('Read More', 'coeur').'';
}
add_filter('excerpt_more', 'coeur_read_more');
add_filter('wp_list_categories', 'coeur_count_span');
function coeur_count_span($links) {
$links = str_replace(' (', ' ', $links);
$links = str_replace(')', '', $links);
return $links;
}