WordPress.org

Forums

Link Categories Designated To A Page? (2 posts)

  1. djones101
    Member
    Posted 6 years ago #

    Lets say I have 50 link Categories. Is it possible to create 50 pages and designate one link category to each of the 50 pages?

    If so how would I do this?

    Is it possible to show me this in an example inside an <ul></ul>

    Thanks

  2. MichaelH
    Member
    Posted 6 years ago #

    1. Change to the WordPress Default Theme:
    2. Save this code as wp-content/themes/default/linkcats.php

    <?php
    /*
    Template Name: LinkCats
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php
    $page = get_query_var('page_id');
    $key = 'link_cat';
    $link_cat = get_post_meta($page, $key, TRUE);
    ?>
    
    <div id="content" class="widecolumn">
    
    <h2>Links:</h2>
    <ul>
    <?php wp_list_bookmarks('category='.$link_cat); ?>
    </ul>
    
    </div>
    
    <?php get_footer(); ?>

    3. Create the 50 Pages, and on each Page assign a Custom Field with a key of 'link_cat' and a value of the Link Category you want to see on each Page. Also to each Page, assign the Template LinkCats.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags