ID, 'business_one_page_sidebar_layout', true );
if( $sidebar_layout == 'no-sidebar' )
$classes[] = 'full-width';
}
return $classes;
}
add_filter( 'body_class', 'business_one_page_body_classes' );
/**
* Hook to move comment text field to the bottom in WP 4.4
*
* @link http://www.wpbeginner.com/wp-tutorials/how-to-move-comment-text-field-to-bottom-in-wordpress-4-4/
*/
function business_one_page_move_comment_field_to_bottom( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
}
add_filter( 'comment_form_fields', 'business_one_page_move_comment_field_to_bottom' );
/**
* Callback function for Comment List *
*
* @link https://codex.wordpress.org/Function_Reference/wp_list_comments
*/
function business_one_page_theme_comment( $comment, $args, $depth ){
$GLOBALS['comment'] = $comment;
extract( $args, EXTR_SKIP );
if ( 'div' == $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
< id="comment-">
'post',
'post_status' => 'publish',
'posts_per_page'=> -1,
'post__in' => $slider_posts,
'orderby' => 'post__in'
) );
if( $qry->have_posts() ){?>
have_posts() ){
$qry->the_post();
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'business-one-page-slider' );
?>
-
$section,
'menu_text' => esc_attr( get_theme_mod( 'business_one_page_' . $section . '_section_menu_title','' ) ),
);
}
}
return $enabled_section;
}
/**
* Callback for Social Links
*/
function business_one_page_social_cb(){
$facebook = get_theme_mod( 'business_one_page_facebook' );
$twitter = get_theme_mod( 'business_one_page_twitter' );
$pinterest = get_theme_mod( 'business_one_page_pinterest' );
$linkedin = get_theme_mod( 'business_one_page_linkedin' );
$google_plus = get_theme_mod( 'business_one_page_google_plus' );
if( $facebook || $twitter || $pinterest || $linkedin || $google_plus ){ ?>
';
if( $twitter ) echo ' ';
if( $pinterest ) echo ' ';
if( $linkedin ) echo ' ';
if( $google_plus ) echo ' ';
?>
';
echo wp_strip_all_tags( $custom_css );
echo '';
}
}
add_action( 'wp_head', 'business_one_page_custom_css', 100 );
if ( ! function_exists( 'business_one_page_excerpt_more' ) && ! is_admin() ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... *
*/
function business_one_page_excerpt_more() {
return ' … ';
}
add_filter( 'excerpt_more', 'business_one_page_excerpt_more' );
endif;
if ( ! function_exists( 'business_one_page_excerpt_length' ) ) :
/**
* Changes the default 55 character in excerpt
*/
function business_one_page_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'business_one_page_excerpt_length' );
endif;
/**
* excerpt length for portfolio section
*/
function business_one_page_excerpt_length_alt( $length ){
return 12;
}
/**
* Footer Credits
*/
function business_one_page_footer_credit(){
$text = '';
echo apply_filters( 'business_one_page_footer_text', $text );
}
add_action( 'business_one_page_footer', 'business_one_page_footer_credit' );
/**
* Return sidebar layouts for pages
*/
function business_one_page_sidebar_layout(){
global $post;
if( get_post_meta( $post->ID, 'business_one_page_sidebar_layout', true ) ){
return get_post_meta( $post->ID, 'business_one_page_sidebar_layout', true );
}else{
return 'right-sidebar';
}
}