• rainer23

    (@rainer23)


    In order to have an overview of all posts is there a shortcut to export only the headlines? And have all the titles on a list?
    Thanks for any idea!

Viewing 10 replies - 1 through 10 (of 10 total)
  • vtxyzzy

    (@vtxyzzy)

    The page shown on this link may be what you want. It is made by creating a Page and assigning a template that only shows post titles, not the full content. The Loop in the template looks like this (some formatting divs removed):

    <h2>Tip Titles</h2>
    
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('posts_per_page=50&paged='.$paged);
    global $post;
    if (have_posts()){
       <div class="postcontent">
          <ul>
             <?php while (have_posts()) {
                the_post(); ?>
                <li class="tip-title">
                   <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
                </li>
             <?php } ?>
          </ul>
       </div>
    <?php } ?>
    Thread Starter rainer23

    (@rainer23)

    Thanks vtxyzzy, yes this is exactly what would do the job!
    You mean, to create a new page at pages/new page but where exactly to enter that code?

    vtxyzzy

    (@vtxyzzy)

    You must create a Template that works with your theme and uses code similar to that above. See the Codex on Stepping Into Templates for information on creating templates and how they work.

    vtxyzzy

    (@vtxyzzy)

    I think I can make it easier for you. Give me a little time and I will add a page to the site above that contains a shortcode function that will be easy to use in your site.

    vtxyzzy

    (@vtxyzzy)

    OK – take a look at this page: Shortcode to List Post Titles

    The shortcode does not do anything fancy – no pagination or category selection, but it could be adapted for those types of things.

    Thread Starter rainer23

    (@rainer23)

    Thanks vtxyzzy, including ‘Shortcode to List Post Titles‘ code into functions.php worked. There are about 3500 articles on my blog. Could be that code above displays all posts on one page and this might be causing what I got:

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35 bytes) in /var/www/web48/html/wp-includes/post.php on line 4351

    In your first post it says, posts_per_page=50. How to include this into script above?

    vtxyzzy

    (@vtxyzzy)

    I have rewritten the shortcode function completely to take an optional posts_per_page setting. Get the new code at this page: Shortcode to List Page Titles

    Thread Starter rainer23

    (@rainer23)

    Thanks vtxyzzy, it works great! First tested it offline with Xampp. Then repeated the same on my wordpress blog. If this is going to be a wordpress plugin I’m giving your work a thumbs-up!
    $posts_per_page = 10, thats where you change the number of titles displayed?

    vtxyzzy

    (@vtxyzzy)

    Be sure you have the latest version of the code that shows the posts_per_page, orderby, and order parameters. Then, you can use the posts_per_page parameter to change the number of titles shown.

    For example, if you wanted 13 titles per page, you would code:

    [mam_list_post_titles posts_per_page=13]

    Thread Starter rainer23

    (@rainer23)

    Again thanks so much, works first class! Since blog = posts, there are quickly lots of posts. I heard of blogs that have 25,000 -30,000 posts. This code could help not to lose track of all those headlines.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Exporting the headlines of all your blog posts’ is closed to new replies.