• Hey,

    sometimes i have only one post in a category and it is not useful to have for users to have to 2 clicks to get to their goal. is there a plugin/hack where i can link a categeory directly to a post?

    thank you in advance

Viewing 13 replies - 1 through 13 (of 13 total)
  • Not clear on what you are asking–I only have to click once on a Category link in either a post or sidebar, and if there’s just one post in that category that post is displayed.

    Note: at first I thought the plugin https://www.ads-software.com/extend/plugins/page-links-to/ was the answer to your problem.

    c-bass,

    It is possible that whatever Theme you are using has altered the way that categories are handled. Are you getting the same behavior if you switch to the WP Default Theme?

    Also, MichaelH is right. It isn’t all that clear what you are asking. Maybe a little more detail?

    Thread Starter c-bass

    (@c-bass)

    funny. that i have the same problem again and i couldnt find a solution for that.

    it is the way of structering the site. wordpress to use as a cms is much more difficult sometimes. all i want is to directly link a category to the latest post in that category.
    the reason is quite easy. i will only have one post in each category. at this way the user has to click on the category, gets then shown the post in there and has to click on the post. i want to save that one click for the user.

    c-bass,

    Did you find a solution for this?

    Im trying to do the exact same thing.

    Thanks

    c-bass – I understand you… but may be the solution is just to use the page system, not the post system to categorize the products…
    I’m struggling on the same problem…

    Yep, clicking a category in the menu brings you to a view generated by either category.php or archive.php Both in standard form usually use the_excerpt and then you need the extra click to show the full post.

    Ralev shows the easy solution. But you then probaly have to work on your menu’s

    A workaround is to make a special template for that one category.
    Say the id of the category is nr 10. Then make a file called cateory-10.php and copy into it the full content of single.php and place it in your theme directory.
    More insight here: https://codex.www.ads-software.com/Template_Hierarchy

    yes, I was thinking about that type of solution.
    thank you for the link.
    The problem with it is that my friend ( the client ) will have to make a new template ( dublicate ) every time he wants to post a new product…
    which is not exactly user-friendly ??

    Hi Ralev,

    I think you start with developing your navigation (thinking it out).
    How to access the detail (pages or posts) for each product?
    This depends greatly on the total number of products.
    Less than 10 in total? Then you can access them straight from the nav menu and I would describe them all in their own page.

    More than 10? And do you want them in categories (if you have more than 50 you would want that anyway)? Search for an online shop plugin or something like that. I think you cannot make an easy direct naviation to more than, say 15, individual pages/posts.

    the shop plugin is something I haven’t thought before ??
    10x

    PS: I was thinking for a plugin that will allow me easily to set a specific predefined template to the category ( as it’s the build-in theme selector for the single posts ), so this way I’m just gonna make one more category template which can show the full post, not only the excerpt…

    This will have 1 big disadvantage, though : SEO duplication problem …
    Or at least I’m with that impression as reading around.

    And with the plugin solution, how would you do the navigation then (if there is more than one product in a category?
    If you have oly one product in each category you could rebuild/make a template category.php identical to single.php and it will automatically be selected. So, no worries for your client (unless he puts two products in a category against your instruction)

    10x for the advice.
    I’ve just done something similar.
    What I’ve done is to make second category plugin.

    <?php /*
         Category Template: skip-to-post
         Template URI: https://ralev.com/
         Description: redirects to the first post in cat
         */ ?>
    <?php
    	if(have_posts()) :
    		while (have_posts()) : the_post();
    		wp_redirect(get_permalink($post->ID));
    		endwhile;
    	endif;
    ?>

    and then call if with the plugin :
    “Idealien Category Enhancements”
    https://www.ads-software.com/extend/plugins/idealien-category-enhancements/

    Now for every created category with one post I can select from a drop-down menu ( in the category panel ) if I want the secondary “skip” template ??
    Works like a charm with WP 2.9! ??

    That’s very good. Never heard before of that plugin (and it says compatible up to 2.8). So you can rate it as working with 2.9 following the link you gave.

    Hi ravel,
    I am using your pluging & it works like a magic on my local machine, but it is not working on live site… My site is hosted on IIS server, will this be the reason? Please help.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to link a category to a post’ is closed to new replies.