Skip to content

Instantly share code, notes, and snippets.

@antenando
Created April 6, 2017 21:34
Show Gist options
  • Save antenando/9ffaf220eb023db7584f8efe8f8ca0c1 to your computer and use it in GitHub Desktop.
Save antenando/9ffaf220eb023db7584f8efe8f8ca0c1 to your computer and use it in GitHub Desktop.
All Wordpressssssssss Posts
<?php
/*
Template Name: Query
*/
?>
<?php get_header(); ?>
<div class="page-content page-explore">
<?php get_template_part('includes/feature','top'); ?>
<div class="content container">
<?php
/* Template Name: Query */
?>
<style>
td, tr{
border: 1px solid grey;
padding: 10px;
}
</style>
<h1>
Lista:
</h1>
<table>
<tbody>
<thead>
<tr>
<td>Conteúdo</td>
<td>Edição</td>
</tr>
</thead>
<?php
// WP_Query arguments
$args = array (
'post_type' => 'post',
'posts_per_page' => -1
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) :
while ( $query->have_posts() ) :
$query->the_post();
?>
<tr>
<td><textarea name="" id="" cols="30" rows="10"><?php print_r(the_content()) ?></textarea></td>
<td><a href="<?php bloginfo('url'); ?>/wp-admin/post.php?post=<?php the_ID(); ?>&action=edit">Editar</a></td>
</tr>
<?php
endwhile;
endif;
// Restore original Post Data
wp_reset_postdata();
?>
</tbody>
</table>
</div>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment