75, 'width' => 300, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ) , ); add_theme_support('custom-logo', $defaults); add_theme_support('post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' )); add_theme_support('woocommerce'); } add_action('after_setup_theme', 'brill_theme_support'); // register menu function brill_register_menus() { register_nav_menus(array( 'primary-menu' => __('Primary Menu', 'brill') , 'footer-menu' => __('Footer Menu', 'brill') , 'social-menu' => __('Social Menu', 'brill') )); } add_action('init', 'brill_register_menus'); // set copyright text function brill_create_copyright() { echo '
$this->get_field_id('cta_page') , 'class' => 'widefat', 'name' => $this->get_field_name('cta_page') , 'selected' => $instance['cta_page'], 'show_option_none' => esc_html__('— Select —', 'brill') , ));; ?> site_url() . '/wp-admin/admin-ajax.php', // WordPress AJAX 'posts' => json_encode($wp_query->query_vars) , // everything about your loop is here 'current_page' => get_query_var('paged') ? get_query_var('paged') : 1, 'max_page' => $wp_query->max_num_pages )); wp_enqueue_script('my_loadmore'); } add_action('wp_enqueue_scripts', 'brill_load_more_scripts'); function brill_loadmore_ajax_handler() { // prepare our arguments for the query $args = json_decode(stripslashes($_POST['query']) , true); $args['paged'] = $_POST['page'] + 1; // we need next page to be loaded $args['post_status'] = 'publish'; // it is always better to use WP_Query but not here query_posts($args); if (have_posts()): // run the loop while (have_posts()): the_post(); get_template_part('template-parts/content', get_post_format()); endwhile; endif; die; } add_action('wp_ajax_loadmore', 'brill_loadmore_ajax_handler'); // wp_ajax_{action} add_action('wp_ajax_nopriv_loadmore', 'brill_loadmore_ajax_handler'); // wp_ajax_nopriv_{action} function brill_customize_register($wp_customize) { $wp_customize->add_section('brill_home_settings', array( 'title' => 'Home page content & settings', 'description' => '', 'priority' => 2, )); $wp_customize->add_section('brill_theme_settings', array( 'title' => 'Theme settings', 'description' => '', 'priority' => 1, )); // ============================= // = Text Input = // ============================= $wp_customize->add_setting('brill_services_heading', array( 'default' => 'Our Services', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control('brill_service_heading_control', array( 'label' => "Service Section Heading", 'section' => 'brill_home_settings', 'settings' => 'brill_services_heading', )); $wp_customize->add_setting('brill_services_desc', array( 'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control('brill_service_desc_control', array( 'label' => "Service Section short Description", 'section' => 'brill_home_settings', 'settings' => 'brill_services_desc', )); $wp_customize->add_setting('brill_recent_post_heading', array( 'default' => 'Recent Post', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control('brill_recent_post_heading_control', array( 'label' => "Recent Post section Heading", 'section' => 'brill_home_settings', 'settings' => 'brill_recent_post_heading', )); $wp_customize->add_setting('brill_blog_btn_text', array( 'default' => 'All Post', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control('brill_blog_btn_text_control', array( 'label' => "Recent Post button text", 'section' => 'brill_home_settings', 'settings' => 'brill_blog_btn_text', )); $wp_customize->add_setting('brill_footer_copyright_text', array( 'default' => 'copyright brillinfotech.com', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control('brill_footer_copyright_text_control', array( 'label' => "Footer Copyright Text", 'section' => 'brill_theme_settings', 'settings' => 'brill_footer_copyright_text', )); $wp_customize->add_setting('brill_theme_color', array( 'default' => 'Red', 'capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control( 'brill_theme_color_control', array( 'settings' => 'brill_theme_color', 'label' => 'Select Theme Color:', 'section' => 'brill_theme_settings', 'type' => 'select', 'choices' => array( 'default' => 'Red', 'blue-theme' => 'Blue' ), )); } add_action('customize_register', 'brill_customize_register'); function brill_get_attachment($attachment_id) { $attachment = get_post($attachment_id); return array( 'alt' => get_post_meta($attachment->ID, '_wp_attachment_image_alt', true) , 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'href' => get_permalink($attachment->ID) , 'src' => $attachment->guid, 'title' => $attachment->post_title ); } add_filter('post_gallery', 'customFormatGallery', 10, 2); function customFormatGallery($string, $attr) { $output = ""; ?> 'Smart Slider 3', // The plugin name. 'slug' => 'smart-slider-3', // The plugin slug (typically the folder name). 'source' => 'https://downloads.wordpress.org/plugin/smart-slider-3.3.3.11.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. ), ); /* * Array of configuration settings. Amend each line as needed. * * TGMPA will start providing localized text strings soon. If you already have translations of our standard * strings available, please help us make TGMPA even better by giving us access to these translations or by * sending in a pull-request with .po file(s) with the translations. * * Only uncomment the strings in the config array if you want to customize the strings. */ $config = array( 'id' => 'brill', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => true, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); }