WordPress.org

Ready to get started?Download WordPress

Forums

Show links from Link manager on a normal page within WordPress (12 posts)

  1. nette
    Member
    Posted 9 years ago #

    Ok I am using the link manager in wordpress to add links to video downloads I have on the site. How can I write a page that also shows a list of all the downloads available in the links manager? Right now I can only get it to show up in the sidebar but I also want a separate page I can link to.
    Thanks

  2. Kafkaesqui

    Posted 9 years ago #

    Create a custom Page template that displays the links in the area The Loop normally resides, then create and assign a "links" Page to it:

    http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates

    Use the "Archives with Content" example there as a starting place.

  3. nette
    Member
    Posted 9 years ago #

    Hmm ok I am new to wordpress and this is a little much. I copied the archives/contet page example and uploaded it to the themes directory as downloads.php. Then I created a new page and made a link in that page directly to the downloads.php page and it didn't work. So I need some more help

  4. Kafkaesqui

    Posted 9 years ago #

    "Then I created a new page and made a link in that page directly to the downloads.php page and it didn't work."

    With a custom Page template you want to *assign* it to the Page. So when creating or editing a Page, you should see it in the Page Template dropdown (in the Page Options section), as long as the theme it's added to is the active one.

  5. oriecat
    Member
    Posted 9 years ago #

    I did something similar on my blog. Here's the basics of my template:

    <?php
    /*
    Template Name: Links
    */
    ?>

    <?php get_header(); ?>

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <div id="content">
    <div class="post">

    <h3 class="storytitle">Page Title Here</h3>

    <?php get_links(); ?>

    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    <?php comments_template(); ?>
    </div>
    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    upload that to the theme, then write a page, leaving it totally blank, and choosing the Links template in the Page Template option.

    You may need to change the get links tag to get it exactly how you want it...

  6. nette
    Member
    Posted 9 years ago #

    Ok here's what I got a blank page so to speak. I don't the layout and the download links are I guess i did something wrong

    http://impeccabledwaynejohnson.net/main1/downloads/

  7. nette
    Member
    Posted 9 years ago #

    Ok now i got it to work but the get_links function I have in my sidebar shows all the available downloads instead of just the latest one. So I tried to change my setting to toggle when a new download is added but then on the downloads page I made it does the same thing and won't show all the downloads..

  8. oriecat
    Member
    Posted 9 years ago #

    What's the template tag you are using?

    What exactly do you want to show?

  9. nette
    Member
    Posted 9 years ago #

    ok
    1. I want to have a page that shows all the available downloads on the site.
    2. I want to be able to call the function in the sidebar and have it show just one new download not all of the available ones which is what it's doing.

  10. oriecat
    Member
    Posted 9 years ago #

    Your sidebar and your Link page template will need to use different get links tags, since you want them to show different things. It sounds like the page is working right?

    In your sidebar you would need to change the get_links tag so it limits the list to 1, and reverse sorts by ID should get the newest one.

    So maybe?
    <?php get_links('-1', '<li>', '</li>', '<br />', TRUE, '_id', TRUE,FALSE, 1, TRUE); ?>

    If your downloads are a specific Link Category, then change the -1 to the LinkCat ID#.

  11. nette
    Member
    Posted 9 years ago #

    Hey thanks it worked!

  12. nette
    Member
    Posted 9 years ago #

    Ok now I have too many downloads on one page how do I put downloads on a page 2?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags