posts from category through the widget bar

Discussion in 'WordPress' started by radiant_luv, Sep 17, 2010.

  1. #1
    Greetings,

    Hoping someone can point me to the right direction.

    
    <?php query_posts('cat=25,6&showposts=5'); ?>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>">
    <?php the_title(); ?></a></li>
    <?php endwhile;?>
    </ul>
    
    Code (markup):
    The above code is working when I have them direct on sidebar.php. However if I use the same code within a custom text widget from the widget section, browser seem to be not renedering the php query and thus throws no content.

    Any idea?
    Thanks
     
    radiant_luv, Sep 17, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    s_ruben, Sep 17, 2010 IP
  3. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am Not Sure if a text Widget can Synthesize PHP!

    It is actually made for JS,Text And HTML!

    ~ExP~
     
    extremephp, Sep 17, 2010 IP
  4. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #4
    radiant_luv, Sep 18, 2010 IP
  5. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Thanks extremephp. yes, I read that too in some resources. A plugin has been reffered by ruben as well.
     
    radiant_luv, Sep 18, 2010 IP