mirror of
https://github.com/10h30/ycb.vn.git
synced 2026-07-11 18:56:17 +09:00
Init
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Page Builder
|
||||
*
|
||||
* This file adds the page builder template to the Business Pro
|
||||
* theme. It removes everything between the site header and footer
|
||||
* leaving a blank template perfect for page builder plugins.
|
||||
*
|
||||
* @package Business Pro
|
||||
* @link https://seothemes.com/themes/business-pro
|
||||
* @author Seo Themes
|
||||
* @copyright Copyright © 2017 Seo Themes
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
|
||||
die;
|
||||
|
||||
}
|
||||
|
||||
// Remove default page header.
|
||||
remove_action( 'genesis_after_header', 'business_page_header_open', 20 );
|
||||
remove_action( 'genesis_after_header', 'business_page_header_title', 24 );
|
||||
remove_action( 'genesis_after_header', 'business_page_header_close', 28 );
|
||||
|
||||
// Remove before footer widget area.
|
||||
remove_action( 'genesis_footer', 'business_before_footer_widget_area', 5 );
|
||||
|
||||
|
||||
/**
|
||||
* Add attributes for site-inner element, since we're removing 'content'.
|
||||
*
|
||||
* @param array $attributes Existing attributes.
|
||||
* @return array Amended attributes.
|
||||
*/
|
||||
function be_site_inner_attr( $attributes ) {
|
||||
// Add the attributes from .entry, since this replaces the main entry
|
||||
$attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );
|
||||
return $attributes;
|
||||
}
|
||||
add_filter( 'genesis_attr_site-inner', 'be_site_inner_attr' );
|
||||
|
||||
|
||||
// Get site-header.
|
||||
get_header();
|
||||
|
||||
//Custom loop, remove all hooks except entry content.
|
||||
if ( have_posts() ) :
|
||||
|
||||
the_post();
|
||||
|
||||
do_action( 'genesis_entry_content' );
|
||||
|
||||
endif; // End loop.
|
||||
|
||||
// Get site-footer.
|
||||
get_footer();
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Business Pro.
|
||||
*
|
||||
* This file adds the landing page template to the Business Pro Theme.
|
||||
*
|
||||
* Template Name: Landing Page
|
||||
*
|
||||
* @package Business Pro
|
||||
* @author SeoThemes
|
||||
* @license GPL-2.0+
|
||||
* @link https://seothemes.com/themes/business-pro
|
||||
*/
|
||||
|
||||
add_filter( 'body_class', 'business_add_body_class' );
|
||||
/**
|
||||
* Add landing page body class to the head.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param array $classes Array of body classes.
|
||||
* @return array $classes Array of body classes.
|
||||
*/
|
||||
function business_add_body_class( $classes ) {
|
||||
|
||||
$classes[] = 'landing-page';
|
||||
|
||||
return $classes;
|
||||
|
||||
}
|
||||
|
||||
remove_action( 'genesis_before_header', 'genesis_skip_links', 5 );
|
||||
add_action( 'wp_enqueue_scripts', 'business_dequeue_skip_links' );
|
||||
/**
|
||||
* Dequeue Skip Links Script.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function business_dequeue_skip_links() {
|
||||
|
||||
wp_dequeue_script( 'skip-links' );
|
||||
|
||||
}
|
||||
|
||||
// Remove site header elements.
|
||||
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
|
||||
remove_action( 'genesis_header', 'genesis_do_header' );
|
||||
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
|
||||
|
||||
// Remove default page header.
|
||||
remove_action( 'genesis_after_header', 'business_page_header_open', 20 );
|
||||
remove_action( 'genesis_after_header', 'business_page_header_title', 24 );
|
||||
remove_action( 'genesis_after_header', 'business_page_header_close', 28 );
|
||||
|
||||
// Add title back (removed in /includes/header.php).
|
||||
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
|
||||
|
||||
// Remove navigation.
|
||||
remove_theme_support( 'genesis-menus' );
|
||||
|
||||
// Remove breadcrumbs.
|
||||
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
|
||||
|
||||
// Remove footer widgets.
|
||||
remove_action( 'genesis_footer', 'genesis_footer_widget_areas', 6 );
|
||||
remove_action( 'genesis_footer', 'business_before_footer_widget_area', 5 );
|
||||
|
||||
// Remove site footer elements.
|
||||
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
|
||||
remove_action( 'genesis_footer', 'genesis_do_footer' );
|
||||
remove_action( 'genesis_footer', 'business_footer_menu', 7 );
|
||||
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
|
||||
|
||||
// Run the Genesis loop.
|
||||
genesis();
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* This file adds the blog masonry template to the Business Pro theme.
|
||||
*
|
||||
* @package Business Pro
|
||||
* @link https://seothemes.com/themes/business-pro
|
||||
* @author Seo Themes
|
||||
* @copyright Copyright © 2017 Seo Themes
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
add_filter( 'body_class', 'business_masonry_body_class', 99 );
|
||||
/**
|
||||
* Add blog-masonry body class.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param array $classes Default body classes.
|
||||
* @return array $classes Default body classes.
|
||||
*/
|
||||
function business_masonry_body_class( $classes ) {
|
||||
|
||||
$classes[] = 'masonry';
|
||||
|
||||
return $classes;
|
||||
|
||||
}
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'business_masonry_scripts' );
|
||||
/**
|
||||
* Enqueue masonry script.
|
||||
*
|
||||
* Uses the masonry script from wp-includes/js/masonry.min.js
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function business_masonry_scripts() {
|
||||
|
||||
// Enqueue script.
|
||||
wp_enqueue_script( 'masonry', '', array( 'js' ), CHILD_THEME_VERSION, true );
|
||||
|
||||
// Add inline script.
|
||||
wp_add_inline_script( 'masonry',
|
||||
'jQuery( window ).on( "load resize scroll", function() {
|
||||
jQuery(".content").masonry({
|
||||
itemSelector: ".entry",
|
||||
columnWidth: ".entry",
|
||||
gutter: 30,
|
||||
});
|
||||
});'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'genesis_post_meta', 'business_entry_meta_footer' );
|
||||
/**
|
||||
* Customize Entry Meta Filed Under and Tagged Under.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return string $post_meta Post meta string.
|
||||
*/
|
||||
function business_entry_meta_footer() {
|
||||
|
||||
$post_meta = get_avatar( get_the_author_meta( 'email' ), 25 );
|
||||
$post_meta .= ' [post_author_posts_link]';
|
||||
$post_meta = '[post_categories]';
|
||||
|
||||
return $post_meta;
|
||||
|
||||
}
|
||||
|
||||
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
|
||||
add_filter( 'genesis_post_info', 'business_post_info_filter' );
|
||||
add_action( 'genesis_entry_header', 'genesis_post_info', 2 );
|
||||
/**
|
||||
* Customize the post info function.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param string $post_info The default post info string.
|
||||
* @return string $post_info Post info string.
|
||||
*/
|
||||
function business_post_info_filter( $post_info ) {
|
||||
|
||||
$post_info = '<i class="fa fa-calendar"></i> [post_date]';
|
||||
|
||||
return $post_info;
|
||||
|
||||
}
|
||||
|
||||
// Reposition the breadcrumbs.
|
||||
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
|
||||
add_action( 'genesis_before_content', 'genesis_do_breadcrumbs' );
|
||||
|
||||
// Move pagination outside of masonry.
|
||||
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
|
||||
add_action( 'genesis_after_content', 'genesis_posts_nav' );
|
||||
|
||||
// Run Genesis.
|
||||
genesis();
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Service Page
|
||||
*
|
||||
* This file adds the service page template to the Business Pro
|
||||
* theme, it adds some basic schema.org micro data to the site
|
||||
* inner div and H1 heading.
|
||||
*
|
||||
* @package Business Pro
|
||||
* @link https://seothemes.com/themes/business-pro
|
||||
* @author Seo Themes
|
||||
* @copyright Copyright © 2017 Seo Themes
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
add_filter( 'genesis_attr_site-inner', 'business_service_site_inner' );
|
||||
/**
|
||||
* Filter the site-inner div.
|
||||
*
|
||||
* Adds schema.org microdata to the site-inner div to declare
|
||||
* the contents as a service.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param array $attr Array of site-inner values.
|
||||
* @return array
|
||||
*/
|
||||
function business_service_site_inner( $attr ) {
|
||||
|
||||
$attr['itemscope'] = 'itemscope';
|
||||
$attr['itemtype'] = 'https://schema.org/Service';
|
||||
|
||||
return $attr;
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'business_hero_title_markup', 'business_service_title' );
|
||||
/**
|
||||
* Filter the page title.
|
||||
*
|
||||
* Adds the correct schema.org markup for service type heading.
|
||||
* The type of service being offered, e.g. veterans' benefits,
|
||||
* emergency relief, etc.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @link http://schema.org/serviceType
|
||||
* @return string
|
||||
*/
|
||||
function business_service_title() {
|
||||
|
||||
return '<h1 itemprop="serviceType">';
|
||||
|
||||
}
|
||||
|
||||
// Run Genesis.
|
||||
genesis();
|
||||
Reference in New Issue
Block a user