Advanced Text Widget
Post Content to Front Page? (2 posts)

  1. imdkiessling@yahoo.com
    Posted 4 years ago #

    I want to include php code in the content loop of my Twenty Eleven front page.

    I've installed the pluggin.

    I added this php code in the advanced text widget entry box.

    <?php include_once(ABSPATH.WPINC.'/rss.php');
    wp_rss('http://www.thepacker.com/fruit-vegetable-news/crops-markets/index.rss', 5); ?>

    Selected Show and Front Page from the drop down menu.

    Clicked Save

    I pasted is_front_page() on Twenty Eleven: Main Index Template (index.php)

    Didn't work.


    Any suggestions?

    The php output showed up in the right sidebar but that is not really where I want it to show up.


  2. Max Chirkov
    Plugin Author

    Posted 4 years ago #

    Hi there,

    the RSS feed output on the right is because you placed the Advanced Text Widget in that sidebar. It actually worked.

    By the way, the function wp_rss() has been deprecated.

    I'm not sure what exactly you're trying to achieve by pasting is_front_page() into the template. First - it has to be entered in PHP context between the <?php ?> tags, otherwise you just printed out an HTML string on a page. Second - this function returns a boolean result - true or false, and usually is being used in conditions like:

    if( is_front_page() ){
      echo "Yey! This is the front page!";
      echo "Shucks! No front page here...";

    In order to output a widget in a desired place, you need to make sure that the desired place is actually a widgetized area (in other words a sidebar). Then drag the widget into that sidebar and it should work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Text Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic