esc_html__( 'Top Menu', 'finance-magazine' ), ) ); add_theme_support( 'html5', array('comment-form','comment-list','gallery','caption',)); add_theme_support('custom-header'); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', array( 'width' => 250, 'height' => 250, 'flex-width' => true, 'flex-height' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); } add_action( 'after_setup_theme', 'finance_magazine_setup' ); function finance_magazine_content_width() { $GLOBALS['content_width'] = apply_filters( 'finance_magazine_content_width', 640 ); } add_action( 'after_setup_theme', 'finance_magazine_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function finance_magazine_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'finance-magazine' ), 'id' => 'sidebar-1', 'romana_description' => esc_html__( 'Add widgets here to appear in your sidebar.', 'finance-magazine' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 1', 'finance-magazine' ), 'id' => 'footer-1', 'romana_description' => esc_html__( 'Add widgets here to appear in your footer.', 'finance-magazine' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'finance-magazine' ), 'id' => 'footer-2', 'romana_description' => esc_html__( 'Add widgets here to appear in your footer.', 'finance-magazine' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'finance-magazine' ), 'id' => 'footer-3', 'romana_description' => esc_html__( 'Add widgets here to appear in your footer.', 'finance-magazine' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'finance-magazine' ), 'id' => 'footer-4', 'romana_description' => esc_html__( 'Add widgets here to appear in your footer.', 'finance-magazine' ), 'before_widget' => '', 'before_title' => '', ) ); } add_action( 'widgets_init', 'finance_magazine_widgets_init' ); /** * Replaces "[...]" (appended to automatically generated excerpts) with ... and * a 'Continue reading' link. */ function finance_magazine_excerpt_more( $link ) { global $post; if ( is_admin() ) : return $link; endif; if ( is_front_page()) : return ''; endif; if ( get_theme_mod( 'hide_post_readmore_button' ) == "" ) : return '

'.esc_html(get_theme_mod('post_button_text',esc_html__('Read More','finance-magazine') )).'

'; endif; } add_filter( 'excerpt_more', 'finance_magazine_excerpt_more' ); // Post Excerpt length function finance_magazine_excerpt_length( $length ) { if ( is_admin() ) : return $length; endif; return absint(get_theme_mod('post_content_limit', 16)); } add_filter( 'excerpt_length', 'finance_magazine_excerpt_length', 999 ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function finance_magazine_pingback_header() { if ( is_singular() && pings_open() ) { printf( '' . "\n", esc_url(get_bloginfo( 'pingback_url' )) ); } } add_action( 'wp_head', 'finance_magazine_pingback_header' ); add_filter( 'wp_nav_menu_items','finance_magazine_add_search_box', 10, 2 ); function finance_magazine_add_search_box( $items, $args ) { if ($args->theme_location == 'primary') { $items .= '
  • ' . get_search_form( false ) . '
  • '; } return $items; } // Header background image if ( ! function_exists( 'finance_magazine_header_image' ) ) : function finance_magazine_header_image() { if( has_header_image()):?> '.get_the_category_list(', ').'' : ''; $finance_magazine_tag_list = get_the_tag_list() ? '
  • '.get_the_tag_list('',', ').'
  • ' : ''; $finance_magazine_author = sprintf( '
  • %3$s
  • ', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), /* translators: 1: author name */ esc_attr( sprintf( __( 'View all posts by %s', 'finance-magazine' ), get_the_author() ) ), get_the_author() ); if(comments_open()) { if(get_comments_number()>=1) $finance_magazine_comments = '
  • '.esc_html(get_comments_number()).'
  • '; else $finance_magazine_comments = ''; } else { $finance_magazine_comments = ''; } $arr = array('li' => array(), 'a' => array('href' => true,'title' => true,), 'i' => array('class'=>true)); if(is_singular()){ printf('%1$s %2$s %3$s %4$s', wp_kses($finance_magazine_category_list,$arr), wp_kses($finance_magazine_author,$arr), wp_kses($finance_magazine_comments,$arr), wp_kses($finance_magazine_tag_list,$arr) ); } } if( ! function_exists( 'wp_body_open' ) ) { function wp_body_open() { do_action( 'wp_body_open' ); } } /* Theme Default function and extra function*/ add_action('tgmpa_register', 'finance_magazine_required_plugins'); function finance_magazine_required_plugins() { if (class_exists('TGM_Plugin_Activation')) { $plugins = array( array( 'name' => __('Contact Form 7', 'finance-magazine'), 'slug' => 'contact-form-7', 'required' => false, ), array( 'name' => __('Category and Taxonomy Image', 'finance-magazine'), 'slug' => 'wp-custom-taxonomy-image', 'required' => false, ), ); $config = array( 'default_path' => '', 'menu' => 'finance-magazine-install-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', 'strings' => array( 'page_title' => __('Install Recommended Plugins', 'finance-magazine'), 'menu_title' => __('Install Plugins', 'finance-magazine'), 'nag_type' => 'updated' ) ); tgmpa($plugins, $config); } } include get_template_directory().'/inc/enqueues.php'; include get_template_directory().'/inc/theme-customization.php'; include get_template_directory().'/inc/custom-breadcumb.php'; include get_template_directory().'/inc/class-tgm-plugin-activation.php';