• Hey,

    I have my blog setup as: https://www.lilwaynehq.com

    Now when you leave my blog and go to a page of my website (such as https://www.lilwaynehq.com/lil-wayne, I would like to have a “Latest News” kind of widget in my sidebar, but I want it to be from my “latest-news” category from my Blog.

    How would I do this?

    So like, on a page of my website, in the sidebar, would be a list of 5 news articles linking to my blog. But it would automatically update as soon as I make a post on my blog.

    Thanks a lot and I appreciate it ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • You could pull the Rss feed from your blog into your site using something like MagpieRSS.

    Thread Starter danaldinho

    (@danaldinho)

    Nope, there is an actually way of doing it, I’ve seen it done before.

    Its just some php code, that will show the latest 5 posts from that “certain category” and you can place that php code on your website.

    It actually might be a plugin, but I’m not sure.

    So does anyone know?

    Thanks a lot and appreciate it ??

    Thread Starter danaldinho

    (@danaldinho)

    Anyone got any ideas?

    Something like this should get you started…

    // Show the last 5 posts in the latest_news category.
      <?php query_posts('category_name=latest_news&showposts=5'); ?>
    
      <?php while (have_posts()) : the_post(); ?>
         <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
     <div class="entry">
       <?php the_content(); ?>
     </div>
    
      <?php endwhile;?>
    Thread Starter danaldinho

    (@danaldinho)

    Alright mate, thanks alot, that worked fine in my blog: https://www.lilwaynehq.com ??

    But is there a way for me to embed that into my website’s pages which are not WordPress as that is what I mainly wanted, but this is a great start ??

    Thanks.

    Oh and this is the code I used:

    <div class="sidebar2">
    <h4 class="widgettitle">Latest Lil Wayne News</h4>
    <?php query_posts('category_name=lil-wayne-news&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <ul>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    </ul>
    <?php endwhile;?>
    </div>
    Thread Starter danaldinho

    (@danaldinho)

    Anyone got any ideas how I could use this on my un-wordpress website, but once you click on the links, it takes you to my blog ??

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use a wordpress catergory in my websites sidebar’ is closed to new replies.