wordpress/php-fpm/wordpress_files/themes/sd-bushwick/index_base.php
2020-05-22 01:40:23 +00:00

118 lines
3.6 KiB
PHP

<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Bushwick
*/
get_header(); ?>
<div id="primary" class="content-area">
<?php get_template_part( 'navigation' ); ?>
<main id="main" class="site-main" role="main">
<?php
//if ( have_posts() ) :
// //the_post();
// /* Include the Post-Format-specific template for the content.
// * If you want to overload this in a child theme then include a file
// * called content-___.php (where ___ is the Post Format name) and that will be used instead.
// */
// //get_template_part( 'content' );
// while ( have_posts() ) :
// the_post();
// $author = get_the_author();
// if ( $author != 'contenido agregado') :
// get_template_part( 'content', 'preview' );
// endif;
// endwhile;
//else :
// get_template_part( 'content', 'none' );
//endif;
?>
<?php
$pagedlocal = isset( $_GET['pagedlocal'] ) ? (int) $_GET['pagedlocal'] : 1;
$pagedaggr = isset( $_GET['pagedaggr'] ) ? (int) $_GET['pagedaggr'] : 1;
// LOOP LOCAL CONTENT
$args1 = array(
'author__not_in'=> array(51), //Authors's id's you like to include
'posts_per_page' => '3',
'paged' => $pagedlocal,
);
$local_content = new WP_Query($args1);
if($local_content->have_posts()) :
while($local_content->have_posts()) :
$local_content->the_post();
get_template_part( 'content', 'preview' );
endwhile;
// http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters
$pag_argslocal = array(
'format' => '?pagedlocal=%#%',
'current' => $pagedlocal,
'total' => $local_content->max_num_pages,
'add_args' => array( 'pagedaggr' => $pagedaggr )
);
echo paginate_links( $pag_argslocal );
else:
echo "Oops, there are no posts.";
endif;
echo '<hr>';
// LOOP AGGREGATED CONTENT
$args2 = array(
'author__in'=> array(51), //Authors's id's you like to include
'posts_per_page' => '2',
'paged' => $pagedaggr,
);
$aggregated_content = new WP_Query($args2);
if($aggregated_content->have_posts()) :
while($aggregated_content->have_posts()) :
$aggregated_content->the_post();
get_template_part( 'content', 'preview' );
endwhile;
// http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters
$pag_args1 = array(
'format' => '?pagedaggr=%#%',
'current' => $pagedaggr,
'total' => $aggregated_content->max_num_pages,
'add_args' => array( 'pagedlocal' => $pagedlocal )
);
echo paginate_links( $pag_arggr );
else: ?>
Oops, there are no posts.
<?php endif; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer();