• Resolved shoober

    (@shoober)


    im using a 2.x and a fairly default theme etc

    1) how do i simply list recent posts from a single category in the sidebar?
    ive tried a dozen things..
    <?php $posts = get_posts(‘category=2&numberposts=5’); ?>
    <?php get_posts(‘category=2&numberposts=5’); ?>
    and some really long complicated ones i found through google
    nothing works, what am i doing wrong?

    2) are there any events calendars that WORK decently?
    ive tried 4 so far and they all appear to pretty much be junk ?? im doing a website for a friends accoustic music. i just want to list a few upcoming show/events….. nothing crazy )

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter shoober

    (@shoober)

    woops i forgot to say that this is in my sidebar.php on the default kubrik theme, dont know if that makes a difference

    There is a plugin that does it auto-magically.
    https://katesgasis.com/2005/10/24/sideblog/

    Or if you want to do it with get_posts use:

    <ul>
    <?php
    $posts = get_posts('numberposts=5&offset=1&category=1');
    foreach($posts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> --- <?php the_excerpt(); ?></li>
    <?php endforeach; ?>
    </ul>

    The problem you were having is that get_posts just looks up the information nothing more. You need to echo it out.
    Read more about get_posts:
    https://codex.www.ads-software.com/Template_Tags/get_posts

    Thread Starter shoober

    (@shoober)

    oh, that makes perfect sense then.. it wasnt erroring out, and i neglect to tell it to actually SHOW me the information ??

    thank you very much for the input

    I’ve learned that the first thing you do when something isn’t working right is to put it into a print_r() statement. It helps a lot with all those pesky multi-demensional arrays.

    For number two have you tried King Calender Widget? I haven’t tried it personally but the guy’s other stuff works well.
    https://www.blog.mediaprojekte.de/cms-systeme/wordpress-plugins/wordpress-widget-king-calendar/

    The only problem is that you will also need the widget plugin, which really can be a plus.
    https://automattic.com/code/widgets/

    Thread Starter shoober

    (@shoober)

    i remember skimming over that one, but its based off the firetree events calendar which i really didnt like very much. i guess its worth a shot though, thank you yet again

    Thread Starter shoober

    (@shoober)

    wow actually that works perfect, you rock!

    the irony here is i was a txp person who only used wordpress because i knew it would be a lot quicker.. now im growing a lot fonder of this than txp!

    definitely digging the simplicity

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘simple sidebar questions’ is closed to new replies.