• I have done due diligence in searching Codex and support for the answer to this question, but no luck. I would like to have my links on a separate page. I’ve changed the “Link” item in my sidebar.php to an a href link to links.php. This is a page that came with the theme I’m using.

    I’m getting this type of error when navigating to the page:

    Warning: main(wp-includes/header.php): failed to open stream: No such file or directory in /home/itgurlf/public_html/blog/wp-content/themes/relaxation/links.php

    It can be seen by clicking “Links” from here:
    https://www.itgurl.com/blog

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff

    (@macmanx)

    The file links.php is only a template, not a page. To create a Links page, you need to create a Page (Write/Wirte page), title it whatever you’d like, don’t enter anything in the “Page Content” box, and select “Links” as your “Page Template:” from the pull-down menu.

    Thread Starter cyclefitness

    (@cyclefitness)

    I did that. Now what? Where was it created and how do I implement it?

    Thanks for your help.

    Moderator James Huff

    (@macmanx)

    Go to Manage/Pages and click the “View” link next to your Links page to view the page and get its URL.

    https://codex.www.ads-software.com/Pages

    Thread Starter cyclefitness

    (@cyclefitness)

    I did follow your instructions, but first deleted the links.php I had in there. It created this:
    https://itgurl.com/blog/index.php/links/

    There are no links there. And I can’t find anywhere in my directory structure where there is a “links” directory to find the page template that got created. How does one interpret that URL?

    My theme is located at:
    /blog/wp-content/themes/relaxation
    Three is no links directory under there, nor are they any new files with today’s date. Not sure how to add my get_links tag until I can find the template file.

    Thank you, again.

    Moderator James Huff

    (@macmanx)

    If you deleted the links.php file in your theme folder, then you just deleted your links template. So, the links page doesn’t work. Also, index.php/links/ is a virtual page. it doesn’t exist on your physical site, but it does exist in your database. So, put your links template (links.php) back into your theme folder, create the page again, and use the URL provided for the page. It will work.

    Thread Starter cyclefitness

    (@cyclefitness)

    Thank you! That worked.

    Now I need to know how to modify the following code to not include the Link Category if there are no links in it:

    <ul id=”links”>
    <?php $link_cats = $wpdb->get_results(“SELECT cat_id, cat_name FROM $wpdb->linkcategories”); foreach ($link_cats as $link_cat) { ?>
    <li id=”linkcat”><h2><?php echo $link_cat->cat_name; ?></h2>

      <li id=”link”><?php get_links($link_cat->cat_id); ?>

    <?php } ?>

    This is a great service. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need Links on Separate Page’ is closed to new replies.