ID, 'attitude_sidebarlayout', true );
}
if( empty( $layout ) || is_archive() || is_search() || is_home() ) {
$layout = 'default';
}
if( 'default' == $layout ) {
$themeoption_layout = $options[ 'default_layout' ];
if( 'left-sidebar' == $themeoption_layout ) {
get_template_part( 'content','leftsidebar' );
}
elseif( 'right-sidebar' == $themeoption_layout ) {
get_template_part( 'content','rightsidebar' );
}
else {
get_template_part( 'content','nosidebar' );
}
}
elseif( 'left-sidebar' == $layout ) {
get_template_part( 'content','leftsidebar' );
}
elseif( 'right-sidebar' == $layout ) {
get_template_part( 'content','rightsidebar' );
}
else {
get_template_part( 'content','nosidebar' );
}
}
/****************************************************************************************/
add_action( 'attitude_before_loop_content', 'attitude_loop_before', 10 );
/**
* Contains the opening div
*/
function attitude_loop_before() {
echo '
';
}
/****************************************************************************************/
add_action( 'attitude_loop_content', 'attitude_theloop', 10 );
/**
* Shows the loop content
*/
function attitude_theloop() {
if( is_page() ) {
if( is_page_template( 'page-template-blog-image-large.php' ) ) {
attitude_theloop_for_template_blog_image_large();
}
elseif( is_page_template( 'page-template-blog-image-medium.php' ) ) {
attitude_theloop_for_template_blog_image_medium();
}
elseif( is_page_template( 'page-template-blog-full-content.php' ) ) {
attitude_theloop_for_template_blog_full_content();
}
else {
attitude_theloop_for_page();
}
}
elseif( is_single() ) {
attitude_theloop_for_single();
}
elseif( is_search() ) {
attitude_theloop_for_search();
}
else {
attitude_theloop_for_archive();
}
}
/****************************************************************************************/
if ( ! function_exists( 'attitude_theloop_for_archive' ) ) :
/**
* Fuction to show the archive loop content.
*/
function attitude_theloop_for_archive() {
global $post;
if( have_posts() ) {
while( have_posts() ) {
the_post();
do_action( 'attitude_before_post' );
?>
>
'
',
'link_before' => '
',
'link_after' => '',
'pagelink' => '%',
'echo' => 1
) );
?>
>
'
',
'link_before' => '
',
'link_after' => '',
'pagelink' => '%',
'echo' => 1
) );
?>
'post', 'paged' => $paged ) );
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $blog_query;
if( $blog_query->have_posts() ) {
while( $blog_query->have_posts() ) {
$blog_query->the_post();
do_action( 'attitude_before_post' );
?>
max_num_pages > 1 ) {
?>
- max_num_pages ); ?>
- max_num_pages ); ?>
'post', 'paged' => $paged ) );
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $blog_query;
if( $blog_query->have_posts() ) {
while( $blog_query->have_posts() ) {
$blog_query->the_post();
do_action( 'attitude_before_post' );
?>
max_num_pages > 1 ) {
?>
- max_num_pages ); ?>
- max_num_pages ); ?>
'post', 'paged' => $paged ) );
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $blog_query;
global $more; // Declare global $more (before the loop).
if( $blog_query->have_posts() ) {
while( $blog_query->have_posts() ) {
$blog_query->the_post();
do_action( 'attitude_before_post' );
?>
>
'
',
'link_before' => '
',
'link_after' => '',
'pagelink' => '%',
'echo' => 1
) );
?>
max_num_pages > 1 ) {
?>
- max_num_pages ); ?>
- max_num_pages ); ?>
max_num_pages > 1 ) :
?>
- ' . _x( '←', 'Previous post link', 'attitude' ) . ' %title' ); ?>
- ' . _x( '→', 'Next post link', 'attitude' ) . '' ); ?>
';
}
/****************************************************************************************/
if ( ! function_exists( 'attitude_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own attitude_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Attitude 1.0
*/
function attitude_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>
id="comment-">
', '' ); ?>
id="li-comment-">
'
',
'link_before' => '
',
'link_after' => '',
'pagelink' => '%',
'echo' => 1
) );
?>