Skip to content

Instantly share code, notes, and snippets.

@palmiak
Last active May 20, 2019 18:48
Show Gist options
  • Save palmiak/3eb2a324f71776b32421d4c03e994aa0 to your computer and use it in GitHub Desktop.
Save palmiak/3eb2a324f71776b32421d4c03e994aa0 to your computer and use it in GitHub Desktop.
<div class="wrapper">
<?php
$args = [ 'posts_per_page' => 3, 'post_type' => 'post' ];
$posts = get_posts( $args );
if ( $posts ) {
echo '<div id="posts">';
foreach( $wpisy as $post ) {
$post = setup_postdata();
echo '<p><a href="'. get_the_permalink().'">'.get_the_title().'</a></p>';
}
echo '</div>';
}
$args = [ 'posts_per_page' => 3, 'post_type' => 'page' ];
$pages = get_posts( $args );
if ( $pages ) {
echo '<div id="strony">';
foreach( $pages as $post ) {
$post = setup_postdata();
echo '<p><a href="'. get_the_permalink().'">'.get_the_title().'</a></p>';
}
echo '</div>';
}
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment