' . $more_tag_text . '';
}
endif; //create_continue_reading
add_filter( 'excerpt_more', 'create_continue_reading' );
if ( ! function_exists( 'create_page_post_meta' ) ) :
/**
* Post/Page Meta for Google Structure Data
*/
function create_page_post_meta() {
$create_author_url = esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) );
$create_page_post_meta = '' . __( 'Posted on', 'create' ) . ' ';
$create_page_post_meta .= '' . __( 'By', 'create' ) . ' ' .get_the_author() . '';
return $create_page_post_meta;
} //create_page_post_meta
endif;
if ( ! function_exists( 'create_seperator' ) ) :
/**
* Return the first image in a post. Works inside a loop.
* @param [integer] $post_id [Post or page id]
* @param [string/array] $size Image size. Either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).
* @param [string/array] $attr Query string or array of attributes.
* @return [string] image html
*
* @since Create 1.2
*/
function create_get_first_image( $postID, $size, $attr ) {
ob_start();
ob_end_clean();
$image = '';
$output = preg_match_all('//i', get_post_field('post_content', $postID ) , $matches);
if( isset( $matches [1] [0] ) ) {
//Get first image
$first_img = $matches [1] [0];
return '
';
}
return false;
} //create_get_first_image
endif;
if ( ! function_exists( 'create_custom_css' ) ) :
/**
* Enqueue Custom CSS
*
* @uses get_theme_mod
*
* @action wp_head
*
* @since Create 1.4
*/
function create_custom_css() {
if( $create_custom_css = get_theme_mod( 'custom_css' ) ) {
echo '' . "\n";
echo '' . "\n" . '' . "\n";
}
}
endif; //create_custom_css
add_action( 'wp_head', 'create_custom_css', 101 );
if ( ! function_exists( 'create_get_theme_layout' ) ) :
/**
* Returns Theme Layout prioritizing the meta box layouts
*
* @uses get_theme_mod
*
* @action wp_head
*
* @since Create 1.4
*/
function create_get_theme_layout() {
global $post, $wp_query;
// Front page displays in Reading Settings
$page_for_posts = get_option('page_for_posts');
// Get Page ID outside Loop
$page_id = $wp_query->get_queried_object_id();
// Blog Page setting in Reading Settings
if ( $page_id == $page_for_posts ) {
$layout = get_post_meta( $page_for_posts, 'create-layout-option', true );
}
// Settings for page/post/attachment
if ( is_singular() ) {
if ( is_attachment() ) {
$parent = $post->post_parent;
$layout = get_post_meta( $parent, 'create-layout-option', true );
}
else {
$layout = get_post_meta( $post->ID, 'create-layout-option', true );
}
}
if ( empty( $layout ) || ( !is_page() && !is_single() ) ) {
$layout = 'default';
}
if ( is_home() && is_front_page() ) {
$layout = get_theme_mod( 'homepage_layout', create_get_default_theme_options( 'homepage_layout' ) );
}
// Check empty and load default.
if ( empty( $layout ) || 'default' === $layout ) {
$layout = get_theme_mod( 'theme_layout', create_get_default_theme_options( 'theme_layout' ) );
}
return $layout;
}
endif; //create_get_theme_layout
if ( ! function_exists( 'create_archive_content_image' ) ) :
/**
* Template for Featured Image in Archive Content
*
* To override this in a child theme
* simply create your own create_archive_content_image(), and that function will be used instead.
*
* @since Create 1.0
*/
function create_archive_content_image() {
$featured_image = get_theme_mod( 'content_layout', create_get_default_theme_options( 'content_layout' ) );
if ( has_post_thumbnail() && 'full-content' != $featured_image ) {
?>
get_queried_object_id();
if( $post) {
if ( is_attachment() ) {
$parent = $post->post_parent;
$individual_featured_image = get_post_meta( $parent,'create-featured-image', true );
} else {
$individual_featured_image = get_post_meta( $page_id,'create-featured-image', true );
}
}
if( empty( $individual_featured_image ) || ( !is_page() && !is_single() ) ) {
$individual_featured_image = 'default';
}
$featured_image = get_theme_mod( 'single_post_image_layout', create_get_default_theme_options( 'single_post_image_layout' ) );
if ( ( 'disable' == $individual_featured_image || '' == get_the_post_thumbnail() || ( $individual_featured_image=='default' && 'disable' == $featured_image ) ) ) {
return false;
}
else {
if ( 'default' == $individual_featured_image ) {
$image_class = $featured_image;
}
else {
$image_class = $individual_featured_image;
}
?>
' . __( 'Scroll Up', 'create' ) . '' ;
}
}
}
add_action( 'create_footer', 'create_scrollup', 110 );
/**
* Alter the query for the main loop in homepage
*
* @action pre_get_posts
*
* @since Create 1.4
*/
function create_alter_home( $query ){
if( $query->is_main_query() && $query->is_home() ) {
$cats = get_theme_mod( 'front_page_category', create_get_default_theme_options( 'front_page_category' ) );
if ( is_array( $cats ) && !in_array( '0', $cats ) ) {
$query->query_vars['category__in'] = $cats;
}
}
}
add_action( 'pre_get_posts','create_alter_home' );