Created
September 10, 2015 12:20
-
-
Save Kudratullah/b0ac025dc06f19e0f0e4 to your computer and use it in GitHub Desktop.
get all post in csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<textarea style="width: 100%; height: 299px;" onclick="select();"> | |
<?php | |
$args = array( | |
'post_type' => array( 'post', 'page', 'media', 'news' ), | |
'posts_per_page' => -1, | |
); | |
echo 'Title of page, URL of Page'. PHP_EOL; | |
$dump = new WP_Query($args); | |
if($dump->have_posts()){ | |
while($dump->have_posts()){ | |
$dump->the_post(); | |
echo get_the_title().",".urldecode(get_the_permalink()).PHP_EOL; | |
} | |
} | |
?> | |
</textarea> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment