Skip to content

Instantly share code, notes, and snippets.

@MatRouault
Created July 26, 2016 06:19
Show Gist options
  • Save MatRouault/703e1a7f709d992a63770a7cad3f7113 to your computer and use it in GitHub Desktop.
Save MatRouault/703e1a7f709d992a63770a7cad3f7113 to your computer and use it in GitHub Desktop.
Replace the entire loop with your own and use Beans post fragment functions in your HTML
<?php
//*https://community.getbeans.io/discussion/customize-post-view-on-index-php/#post-1737
beans_modify_action_callback( 'beans_loop_template', 'example_loop' );
function example_loop() {
if ( have_posts() && !is_404() ) : while ( have_posts() ) : the_post(); ?>
<article>
<header>
<?php
beans_post_title();
beans_post_meta();
?>
</header>
<div>
<?php beans_post_content(); ?>
</div>
</article>
<?php endwhile; else : ?>
<div class="uk-alert">No Posts</div>
<?php endif;
// Display posts pagination.
beans_posts_pagination();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment