WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creating alternative, simpler page (5 posts)

  1. Bodhipaksa
    Member
    Posted 7 years ago #

    I've used WordPress to organize an archive of links to news stories about meditation. It's at http://www.wildmind.org/meditation/news2/. It has huge advantages over the old hand-coded pages we used to have, because it includes searchability, categorization, etc. I love it!

    There's just one drawback. I used to cut-and-paste the html code from the old static pages for use in an html newsletter. Now, I can copy the code from WordPress but I have to strip out all the code that's meant just for WordPress: stuff like <div class="post" id="post-2486"> and <div class="entry">. That's very time-consuming.

    What I can't figure out (and it's probably simple, but I don't have much expertise) is how to create an alternative page that has the news stories with just the plain-vanilla html h2, br, and p tags without all the divs. This page would be just for my use and not publically viewable. Obviously I want to leave all the public pages just as they are.

    What would be ideal would be a page that contained all the posts from a given (usually the current) calendar month.

    Any ideas?

  2. Kafkaesqui

    Posted 7 years ago #

    Take a look at GaMerZ WP-Print script, found here:

    http://www.lesterchan.net/portfolio/programming.php

    You can pass it any WordPress query, such as:

    /wpprint.php?p=101
    /wpprint.php?cat=10
    /wpprint.php?year=2006&monthnum=10

    Should be easy enough to modify the layout to your needs.

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Create a new file in your main blog directory. Call it "simple.php" or something like that. Put this code in there:

    <?php
    require('./wp-blog-header.php');
    if (have_posts()) :
    while (have_posts()) : the_post();
    ?>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    -
    <?php endwhile; ?>
    <?php next_posts_link('Previous Entries') ?> -
    <?php previous_posts_link('Next Entries') ?>
    <?php endif; ?>

    Run it with http://yourblog.com/simple.php.

    Hopefully this simple example is enough to get you started on your own custom one to fit your needs.

    BTW, if it doesn't work, well, it only took 30 seconds to write, so hey, don't expect much. ;)

  4. Bodhipaksa
    Member
    Posted 7 years ago #

    If you weren't called Otto, I'd kiss you! Thanks very much for saving me from hours of fiddling around.

  5. Corny
    Member
    Posted 6 years ago #

    News now spider page

    Otto42, thank you for the script above. I needed a page with links only and link titles and I managed to put this version together, works a treat.

    <?php
    require('./wp-blog-header.php');
    if (have_posts()) :
    while (have_posts()) : the_post();
    ?>
    
    <h2><a><a href="<?php echo the_permalink();?>"><?php echo the_title();?></a></h2>
    
    <?php endwhile; ?>
    <?php next_posts_link('Previous Entries') ?> -
    <?php previous_posts_link('Next Entries') ?>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags