• On my site, I have links on my sidebar that show the two most current books I’m reading, movies I’m watching, etc. The way I do it now is I add a new book or movie link and make it visible, and then go to the older link and make it invisible. I have the category setting to only show 2, but it doesn’t update the two based on the add date, as I would expect. That is part #1 of my problem…

    The second part stems from part #1. I would like to have a separate page that pulls in those links as a sort of “library” of books, movies. But I can’t get that to happen since I need to turn the visibilty “off” in order for only 2 recently entries to show up.

    Can anyone explain specifically how to do this, rather than pointing to a support document? I ask this only b/c I have read those docs and I just don’t understand. I’ve had other WP using friends check it out and they don’t know either. But this seems like it should be simple. Any help please? Thank you so so much!

    http://varresa.org

Viewing 4 replies - 1 through 4 (of 4 total)
  • I think you need to look into your template and look at the template tag that generates your link list. There is a variable that allows it to display based on date added. So if you only allow 2 you don’t need to set the others to not visible since it will only display the latest two. That will also solve the second problem.

    http://codex.wordpress.org/Template_Tags/get_links

    Sounds like you need to use the SideBlogging plugin, set it to display 2 entries only, and put all the books into the category set for your sideblog. That way visitors can view every book by viewing the category where you put the books, but the sidebar will only show that latest 2, with the most recent one on top.

    RagManX

    Thread Starter varresa

    (@varresa)

    Thank you for your replies – can I have a little more info on the template tags? Below is that I currently have in my sidebar.php file. I tried changing this code a couple times based on in the info in the template tags link above, but I couldn’t get it to specifically apply to the 3 categories I am trying to manipulate. Instead, it would just put ALL my links in one long list down the side. What should I replace this with (below)? Thanks!

    <?php /* If this is the frontpage */ if ( (is_home()) && !(is_page()) && !(is_single()) && !(is_search()) && !(is_archive()) && !(is_author()) && !(is_category()) && !(is_paged()) ) { ?>

    <?php

    $links_list_exist = @$wpdb->get_var("SELECT link_id FROM $wpdb->links LIMIT 1");

    if($links_list_exist) {

    ?>

    <div class="sb-links">

    <ul>

    <?php get_links(); ?>

    </ul>

    </div>

    <?php } ?>

    You should fill in get_links() with the values you need. Eg look at the page in the codex for the use of it:

    <?php get_links(category, ‘before’, ‘after’,
    ‘between’, show_images, ‘order’,
    show_description,show_rating, limit,
    show_updated, echo); ?>

    and then look at the explanation down the page. You should be able to get something like

    <?php get_links(‘-1’, ‘

    • ‘, ‘
    • ‘, ‘
      ‘, FALSE, ‘id’, TRUE,
      TRUE, -1, TRUE); ?>

      but accustomed to your own taste.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Links Visible/Not Visible’ is closed to new replies.