Forums

Importing (including) links into a page (8 posts)

  1. shanx99
    Member
    Posted 5 years ago #

    Hi all

    The VSlider theme i use (and need) places my blogroll/links far down on the right hand sidebar of my page.

    I was wondering if there is an easy way to create a new page and include some code that will show all links in my link manager? i.e. save me from retyping all my links and simply have a page named 'links' on my header that holds my links and updates itself dynamically as the blogroll/sidebar links section currently does.

    P.S. I had to completely reinstall wp after trying to do this myself (including sidebar link code in the page titled links). I clearly did something wrong so I don't want to go through that again!!

    Many thanks in advance,

    David

  2. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Have a look over this. You just create a new template based off your main page template but just include this in the body instead of the WP loop.

  3. shanx99
    Member
    Posted 5 years ago #

    Hi,

    thanks for that, looks like the job.

    However, how/where do I include this code? I thought Id simply create a new page, go to "code" view instead of visual and insert

    <?php wp_list_bookmarks(); ?>

    When I save this, nothing comes up on the newly created page.

    Any ideas? Am I doing something silly??

    Thanks again,

    David

  4. Jeremy Clark
    Moderator
    Posted 5 years ago #

    The easiest way would be to open your main index template in you theme editor and copy the contents out of it. Create a new template file called links.php then paste the contents into the new template then you can edit out everything between these two tags including deleting the tags themselves.

    <?php if (have_posts()) : ?>
    Text stuff
    <?php endwhile; ?>

    Then in the blank space left by that insert your
    <?php wp_list_bookmarks(); ?> tag then save everything then upload the new file to your themes directory. Then create a new page giving it a name such as Links and over on the side there should be an area that says page template change that to your new links template. For reference have a look here.

  5. shanx99
    Member
    Posted 5 years ago #

    hi,

    ive done this but am not getting the "links.php" to show up in the page template selection box when i go to create the page.

    I currently have it placed in my VSlider2 directory. SHould it be elsewhere? Or maybe links.php is a reserved wordpress name or something?

    Thanks

    David

  6. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Sorry I forgot a step. Add this code to the top of your links.php template.

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

    Then your new template will show up as Links Page. You've placed it in the correct place if you can see it with your theme editor when editing your Vslider2 theme.

  7. shanx99
    Member
    Posted 5 years ago #

    Links page came up ok but when i create a page using it, it comes up totally blank...

    Any ideas?

    Thanks

    David

  8. Jeremy Clark
    Moderator
    Posted 5 years ago #

    If you could copy and paste the template source here we can see if everything looks correct.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.