* * @package WordPress * @subpackage Beautiful * @since Beautiful 1.0 */ if( !class_exists("beautiful_content") ) : /** * functions for content area */ class beautiful_content extends beautiful_core { /** * content start */ public function content_start() { echo '
'; } /** * end of the blogroll content * @param query $query * @return navigation */ public function content_end($query = "") { ?>
blog_navigation($query) ?> home-slider-half-width * 1920×960 -> home-slider-full-width * * @var string */ if( $thumbnail == "home-slider-full-width" ) : ?>
$sticky, // pagination 'paged' => $paged, 'posts_per_page' => get_option('posts_per_page') ); // get posts that are not sticky $query = new WP_Query( $args ); // loop throgh them if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); // display each post beautiful_blog_post(); endwhile; endif; // reset previous query wp_reset_query(); $this->content_end($query); // show sticky posts else : if (have_posts()) : while (have_posts()) : the_post(); // display each post beautiful_blog_post(); endwhile; endif; $this->content_end(); endif; // show posts from one or more category(s) else : // ready for paginating custom query $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; // make query var out of the loops $query = ""; // hide sticky posts if( ot_get_option( "sticky_posts" ) == "off" ) : // args for wp_query $args = array( // exclude sticky posts 'post__not_in' => $sticky, // posts in specefic category(s) 'category__in' => ot_get_option("beautiful_categories") , // pagination 'paged' => $paged, 'posts_per_page' => get_option('posts_per_page') ); // get posts that are not sticky $query = new WP_Query( $args ); // show sticky posts else : // args for wp_query $args = array( // exclude sticky posts 'post__in' => $sticky, // posts in specefic category(s) 'category__in' => ot_get_option("beautiful_categories") , // pagination 'paged' => $paged, 'posts_per_page' => get_option('posts_per_page') ); // get posts that are not sticky $query = new WP_Query( $args ); endif; // save query for pagination methode $this->query = $query; // loop throgh them if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); // display each post beautiful_blog_post(); endwhile; endif; // reset previous query wp_reset_query(); $this->content_end($query); endif; } /** * post navigation * @return blog navigation */ function blog_navigation($query) { // intial $get_next_posts_link = get_next_posts_link(); $get_previous_posts_link = get_previous_posts_link(); // get max number of pages $max_num_pages = 12; if( !empty ( $query ) ) { $max_num_pages = $query->max_num_pages; } // also changing position of post navigation based on rtl or ltr if( !empty( $get_next_posts_link ) || !empty( $get_previous_posts_link ) ) : if( !is_rtl() ) : ?>
' . __("previous posts", "beautiful") . '', $max_num_pages); ?>
' . __("next posts", "beautiful") . ' ', $max_num_pages); ?>
' . __("previous posts", "beautiful") . ' ', $max_num_pages); ?>
' . __("next posts", "beautiful") . '', $max_num_pages); ?>
spectrum_colors($number, $color, $diff); } /** * make random color for boxes/lists at each call * @return color */ public function random() { echo $this->random_color(); } /** * make all boxes/lists same color * @return color */ public function same_color() { // get base color $color = get_theme_mod("beautiful_same_color"); // make it rgba with alpha 0.9 $color = $this->hex2rgba($color, 0.9); echo $color; } /** * return each box box color * @param box number $number * @return color */ public function box($number) { // get color $color = get_theme_mod("beautiful_box_" . $number); // make it rgba with alpha 0.9 $color = $this->hex2rgba($color, 0.9); echo $color; } /** * return carousel * @return carousel */ public function get_carousel() { // full width carousel if( get_theme_mod("beautiful_homepage_slider_style") == "full_width" ) : echo $this->carousel("home-slider-full-width"); // half width carousel else: echo $this->carousel("home-slider-half-width"); endif; } } // class beautiful_content extends beautiful_core endif; // if( !class_exists("beautiful_content") ) :