for posts and comments. add_theme_support( 'automatic-feed-links' ); // Enable support for Post Thumbnails, and declare two sizes. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 672, 372, true ); add_image_size( 'freemium-full-width', 1038, 576, true ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( 'primary' => __( 'Main menu', 'freemium' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', ) ); // This theme allows users to set a custom background. add_theme_support( 'custom-background', apply_filters( 'freemium_custom_background_args', array( 'default-color' => 'f5f5f5', ) ) ); // Add support for featured content. add_theme_support( 'featured-content', array( 'featured_content_filter' => 'freemium_get_featured_posts', 'max_posts' => 6, ) ); } endif; // freemium_setup add_action( 'after_setup_theme', 'freemium_setup' ); // Implement Custom Header features. require get_template_directory() . '/functions/custom-header.php'; //Theme Title function freemium_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', 'freemium' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', 'freemium_wp_title', 10, 2 ); // thumbnail list function freemium_thumbnail_image($content) { if( has_post_thumbnail() ) return the_post_thumbnail( 'thumbnail' ); } function freemium_font_url() { $font_url = ''; /* * Translators: If there are characters in your language that are not supported * by Lato, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Lato font: on or off', 'freemium' ) ) { $font_url = add_query_arg( 'family', urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), "//fonts.googleapis.com/css" ); } return $font_url; } //enqueue scripts and styles function freemium_scripts() { wp_enqueue_style('style', get_stylesheet_uri()); wp_enqueue_style( 'style-bootstrap', get_stylesheet_directory_uri().'/css/bootstrap.css' ); wp_enqueue_style( 'style-custom', get_stylesheet_directory_uri().'/css/custom.css' ); wp_enqueue_script('jquery'); wp_enqueue_script( 'script-bootstrap-hover', get_template_directory_uri() . '/js/bootstrap-hover-dropdown.js', array('jquery'), '1.0' ); wp_enqueue_script( 'script-bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), '1.0' ); wp_enqueue_script( 'script-default', get_template_directory_uri() . '/js/default.js', array('jquery'), '1.0' ); if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'freemium_scripts'); if ( ! function_exists( 'freemium_entry_meta' ) ) : /** * Set up post entry meta. * * Meta information for current post: categories, tags, permalink, author, and date. **/ function freemium_entry_meta() { $category_list = get_the_category_list( __( ', ', 'freemium' ) ); $tag_list = get_the_tag_list( '', __( ', ', 'freemium' ) ); $date = sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $author = sprintf( '%3$s', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'freemium' ), get_the_author() ) ), get_the_author() ); if ( $tag_list ) { $utility_text = __( '
Posted in : %1$s on %3$s
by : %4$s
Comments: '.get_comments_number().'.
', 'freemium' ); } elseif ( $category_list ) { $utility_text = __( '
Posted in : %1$s on %3$s
by : %4$s
Comments: '.get_comments_number().'.
', 'freemium' ); } else { $utility_text = __( '
Posted on : %3$s
by : %4$s
Comments: '.get_comments_number().'.
', 'freemium' ); } printf( $utility_text, $category_list, $tag_list, $date, $author ); } endif; add_action( 'widgets_init', 'freemium_widgets_init' ); /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own freemium_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * */ if ( ! function_exists( 'freemium_comment' ) ) : function freemium_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • comment_approved==1) { global $post; ?>
  • id="li-comment-">
    %1$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author ', 'freemium' ) . '' : '' ); ?> '; echo ''.comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'freemium' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ).''; ?>
    Continue reading →'; } add_filter( 'excerpt_more', 'freemium_read_more' ); /** * Add default menu style if menu is not set from the backend. */ function freemium_add_menuid ($page_markup) { preg_match('/^
    /i', $page_markup, $matches); $divclass = $matches[1]; $toreplace = array('
    ', '
    '); $replace = array(''); $new_markup = str_replace($toreplace,$replace, $page_markup); $new_markup= preg_replace('/