• I’m looking to split off <?php get_links_list(); ?> onto a separate page, and was wondering if there’s a simple way to do that without creating another page? i.e. is there a flag such as ‘single’ that I can use that displays just the links list rather than posts? TIA

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you make a copy of index.php, called “links.php”, you could strip out the entire contents of “the loop” — everything from
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    down to
    <?php endif; ?>
    Then you could style the page to be however you want.

    Thread Starter ryanschwartz

    (@ryanschwartz)

    That’s exactly what I don’t want to do – copy the page and have a second template. Any other ideas? Perhaps I’ll dig into the code and see if I can’t get it done…

    You could create logic above the start of the loop that checks for the presence of some GET variable you create (say, ?linksonly=1). If set, then show your links only and skip “the loop”, else display “the loop” as normal. Then you could use rewrite rules to treat /links/ as index.php?linksonly=1

    Ryan,
    You really only have two good choices. You can create the logic skippy is talking about – similar to what I used in my statistics plugin:
    https://www.ads-software.com/support/10/5399
    (download it and look at the install directions to see what I mean)
    The only other viable option would be to duplicate index.php. This isn’t really as bad as it sounds, since wp-layout.css is what is really defining what the page will look like.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I get index.php to only show links?’ is closed to new replies.