Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I display the latest questions in the websites' homepage?


  • wpmhweb
    Participant

    @wppit

    I am using WordPress 3.4.2 and I would like to display the latest questions (last 5 or 10 Qs) in my static homepage. There is a way to add some code to my template and display bbpress questions?

    Thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Add the [bbp-topic-index] shortcode to your page.

    http://codex.bbpress.org/shortcodes/


    wpmhweb
    Participant

    @wppit

    Hi, thanks for the answer, but I meant in the theme as inside of the PHP template files. How could I bring for example the latest questions to the front static homepage.

    Thanks


    Shane Gowland
    Participant

    @thewebatom

    You can use the shortcode in the PHP template files with the do_shortcode() function.

    echo do_shortcode('[bbp-topic-index]'); would do the trick.

    Of course; there is a performance overhead involved with making WordPress parse the shortcode before displaying the content. Using WP_Query and creating a custom loop would be the ideal method, but it’s also much trickier.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.