Forums

categories will not show in home page. (7 posts)

  1. ballyknock
    Member
    Posted 3 months ago #

    Hi,have added Links page to blog, page is there but cannot get a Links category to show on home page, also home page shows as no categories.
    Appreciate any advice
    Many thanks

  2. MichaelH
    Moderator
    Posted 3 months ago #

    You may need to use the template tag, wp_list_bookmarks(), to display Links and Link Categories.

    Your blog (the accessible via your Profile) shows one post on the main page with the Uncategorized category so not sure what you are wanting.

    Editing Files
    Stepping Into Templates
    Stepping Into Template Tags

  3. ballyknock
    Member
    Posted 3 months ago #

    Hi, thank you for your reply, I am looking to have a clickable link for the Links Page which did not appear on the blog home page when the Links page was created, also any categories I would create the home page still says no categories, maybe I am missing something, appreciate any advice.
    Kind regards

  4. MichaelH
    Moderator
    Posted 3 months ago #

    Change to the WordPress Default 1.6 Theme to see if the Links page appears. You may need to add the template tag, wp_list_pages(), (if Links is an actual Page) to your theme.

    Your categories may not show until you assign those categories to a post. If your theme uses the template tag, wp_list_categories(), you may have to use the hide_empty=0 parameter to show categories with no posts.

  5. jonimueller
    Member
    Posted 3 months ago #

    bally, do you mean that you want to set up your links on a WP Page and then have a link to that Page in your sidebar?

    I have a setup like that. I created a Page Template specifically for the links. Just make a copy of your page.php template and put this at the very top of the file:

    <?php
    /*
    Template Name: Links  < you can call it what you want
    */
    ?>

    Then this is the "guts" of your new template. Make sure you don't delete the WP Loop (and the flip side of that is make sure it isn't in there twice as a result of cutting and pasting this code). Then put this inside whatever division you use for your page content:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<div class="post" id="post-<?php the_ID(); ?>">
    	<h2><?php the_title(); ?></h2>
    		<div class="entry">
    		<?php the_content('Read the rest of this page &raquo;
    '); ?>
    
    		<ul>
    		<?php wp_list_bookmarks('show_description=true&between=:  '); ?>
    		</ul>
    		</div><!-- /entry -->
    	</div><!-- /post -->
    <?php endwhile; endif; ?>

    Notice the styling of the bookmarks? I have the description turned on; change that to false if you don't want this but since this is a page of links, the description should be there. Also, the divider between the link and the description in my case is : -- you may want something different, a linebreak or a hyphen/dash. It's all up to you. The page will call whatever links and descriptions you have set up, in alpha order by link category. HTH.

  6. jonimueller
    Member
    Posted 3 months ago #

    Whoops, I should also give you the code to put in your stylesheet to make the bullets go away, since the links are presented as an Unordered List:

    /* Styling for the bookmarks/links on the Links page */
    ul li.linkcat h2, h2.linkcat, li.linkcat, .linkcat {
    	list-style-type: none !important;
    }
  7. ballyknock
    Member
    Posted 3 months ago #

    Many thanks Jonimueller, think that is just what I was looking, have setup a links page and was looking a link on WP page to the links page as you describe.
    Many thanks for your help

Reply

You must log in to post.

About this Topic