<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: HELP custom headers conditional tags</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: HELP custom headers conditional tags</description>
<language>en</language>
<pubDate>Thu, 26 Nov 2009 14:09:13 +0000</pubDate>

<item>
<title>littlecuriosity on "HELP custom headers conditional tags"</title>
<link>http://wordpress.org/support/topic/284013#post-1116837</link>
<pubDate>Thu, 25 Jun 2009 23:01:48 +0000</pubDate>
<dc:creator>littlecuriosity</dc:creator>
<guid isPermaLink="false">1116837@http://wordpress.org/support/</guid>
<description>&#60;p&#62;too complicated
&#60;/p&#62;</description>
</item>
<item>
<title>littlecuriosity on "HELP custom headers conditional tags"</title>
<link>http://wordpress.org/support/topic/284013#post-1116834</link>
<pubDate>Thu, 25 Jun 2009 23:00:17 +0000</pubDate>
<dc:creator>littlecuriosity</dc:creator>
<guid isPermaLink="false">1116834@http://wordpress.org/support/</guid>
<description>&#60;p&#62;And how does that replace the header.jpg in the css?&#60;/p&#62;
&#60;p&#62;Thanks anyway but I've found a better method&#60;br /&#62;
&#60;a href=&#34;http://ma.tt/scripts/randomimage/&#34; rel=&#34;nofollow&#34;&#62;http://ma.tt/scripts/randomimage/&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://codex.wordpress.org/Designing_Headers&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Designing_Headers&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;theres also a cool plugin&#60;br /&#62;
Header Image Rotator
&#60;/p&#62;</description>
</item>
<item>
<title>esmi on "HELP custom headers conditional tags"</title>
<link>http://wordpress.org/support/topic/284013#post-1116815</link>
<pubDate>Thu, 25 Jun 2009 22:33:12 +0000</pubDate>
<dc:creator>esmi</dc:creator>
<guid isPermaLink="false">1116815@http://wordpress.org/support/</guid>
<description>&#60;p&#62;The code would need to be added to header.php and might look something like:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php if(is_page(&#38;#39;foo&#38;#39;)) $page_style=&#38;#39;foo&#38;#39;;
elseif((is_page(&#38;#39;bar&#38;#39;)) $page_style=&#38;#39;bar&#38;#39;;
else $page_style=&#38;#39;default&#38;#39;;
?&#38;gt;
&#38;lt;div id=&#38;quot;header&#38;quot; class=&#38;quot;&#38;lt;?php echo $page_style);?&#38;gt;&#38;quot;&#38;gt;
[.. rest of header ..]&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The different images could then be applied via the page-specific classes in the theme's stylesheet.
&#60;/p&#62;</description>
</item>
<item>
<title>littlecuriosity on "HELP custom headers conditional tags"</title>
<link>http://wordpress.org/support/topic/284013#post-1116750</link>
<pubDate>Thu, 25 Jun 2009 21:35:14 +0000</pubDate>
<dc:creator>littlecuriosity</dc:creator>
<guid isPermaLink="false">1116750@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Please bear in mind the header image is writen within the stylesheet
&#60;/p&#62;</description>
</item>
<item>
<title>littlecuriosity on "HELP custom headers conditional tags"</title>
<link>http://wordpress.org/support/topic/284013#post-1116729</link>
<pubDate>Thu, 25 Jun 2009 21:20:06 +0000</pubDate>
<dc:creator>littlecuriosity</dc:creator>
<guid isPermaLink="false">1116729@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Hi I'm trying to add a custom header for each page of my blog but don't know where to put the code for as shown by wordpress conditional tags. &#60;a href=&#34;http://codex.wordpress.org/Conditional_Tags&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Conditional_Tags&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Anyone got any ideas?&#60;/p&#62;
&#60;p&#62;Thanks&#60;br /&#62;
Judi&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/**
 * @package WordPress
 * @subpackage Magazeen_Theme
 */

if ( function_exists(&#38;#39;register_sidebar&#38;#39;) )
    register_sidebar(array(
        &#38;#39;before_widget&#38;#39; =&#38;gt; &#38;#39;&#38;lt;li id=&#38;quot;%1$s&#38;quot; class=&#38;quot;widget %2$s&#38;quot;&#38;gt;&#38;#39;,
        &#38;#39;after_widget&#38;#39; =&#38;gt; &#38;#39;&#38;lt;/li&#38;gt;&#38;#39;,
        &#38;#39;before_title&#38;#39; =&#38;gt; &#38;#39;&#38;lt;h5 class=&#38;quot;widgettitle&#38;quot;&#38;gt;&#38;#39;,
        &#38;#39;after_title&#38;#39; =&#38;gt; &#38;#39;&#38;lt;/h5&#38;gt;&#38;#39;,
    ));

/* Comments
/* ----------------------------------------------*/

function magazeen_comment( $comment, $args, $depth ) {

  $GLOBALS[ &#38;#39;comment&#38;#39; ] = $comment;
?&#38;gt;

  &#38;lt;li id=&#38;quot;comment-&#38;lt;?php comment_ID() ?&#38;gt;&#38;quot; &#38;lt;?php comment_class( &#38;#39;clearfix&#38;#39; ); ?&#38;gt;&#38;gt;

    &#38;lt;div class=&#38;quot;comment-wrap clearfix&#38;quot;&#38;gt;

      &#38;lt;div class=&#38;quot;comment-author clearfix&#38;quot;&#38;gt;

        &#38;lt;?php
          $comment_type = get_comment_type();
          if( $comment_type == &#38;#39;comment&#38;#39; ) :
        ?&#38;gt;
          &#38;lt;div class=&#38;quot;gravatar&#38;quot;&#38;gt;
            &#38;lt;?php echo get_avatar( $comment, $size=&#38;#39;38&#38;#39; ); ?&#38;gt;
          &#38;lt;/div&#38;gt;
        &#38;lt;?php
          endif;
        ?&#38;gt;
        &#38;lt;div class=&#38;quot;author&#38;quot;&#38;gt;
          &#38;lt;strong class=&#38;quot;name&#38;quot;&#38;gt;&#38;lt;?php echo get_comment_author_link(); ?&#38;gt;
          &#38;lt;?php if( $comment_type == &#38;#39;comment&#38;#39; ) : ?&#38;gt;
            &#38;lt;span class=&#38;quot;reply&#38;quot;&#38;gt;&#38;lt;?php comment_reply_link( array_merge( $args, array( &#38;#39;reply_text&#38;#39; =&#38;gt; &#38;#39;(Reply)&#38;#39;, &#38;#39;depth&#38;#39; =&#38;gt; $depth, &#38;#39;max_depth&#38;#39; =&#38;gt; $args[&#38;#39;max_depth&#38;#39;] ) ) ); ?&#38;gt;&#38;lt;/span&#38;gt;
          &#38;lt;?php endif; ?&#38;gt;
          &#38;lt;/strong&#38;gt;
          &#38;lt;?php if( $comment_type == &#38;#39;comment&#38;#39; ) : ?&#38;gt;
            &#38;lt;span class=&#38;quot;date&#38;quot;&#38;gt;on &#38;lt;?php the_time( &#38;#39;l j, Y&#38;#39; ) ?&#38;gt;&#38;lt;/span&#38;gt;
          &#38;lt;?php endif; ?&#38;gt;
        &#38;lt;/div&#38;gt;

      &#38;lt;/div&#38;gt;&#38;lt;!-- End comment-author --&#38;gt;

      &#38;lt;div class=&#38;quot;comment-text&#38;quot;&#38;gt;
        &#38;lt;?php if ($comment-&#38;gt;comment_approved == &#38;#39;0&#38;#39;) : ?&#38;gt;
          &#38;lt;p&#38;gt;&#38;lt;em&#38;gt;&#38;lt;?php _e(&#38;#39;Your comment is awaiting moderation.&#38;#39;) ?&#38;gt;&#38;lt;/em&#38;gt;&#38;lt;/p&#38;gt;
             &#38;lt;?php endif; ?&#38;gt;

        &#38;lt;?php comment_text(); ?&#38;gt;
      &#38;lt;/div&#38;gt;&#38;lt;!-- End comment-text --&#38;gt;

    &#38;lt;/div&#38;gt;&#38;lt;!-- End comment-wrap --&#38;gt;  

&#38;lt;?php

}

/* Featured News Widget
/* ----------------------------------------------*/  

function featured_news() {

  $settings = get_option( &#38;#39;widget_featured_news&#38;#39; );
  $number = $settings[ &#38;#39;number&#38;#39; ];
  $category = $settings[ &#38;#39;category&#38;#39; ];

?&#38;gt;

  &#38;lt;li id=&#38;quot;featured-news&#38;quot;&#38;gt;&#38;lt;h5&#38;gt;Featured News&#38;lt;/h5&#38;gt;
    &#38;lt;ul&#38;gt;

      &#38;lt;?php
        $recent = new WP_Query( &#38;#39;showposts=&#38;#39; . $number . &#38;#39;&#38;amp;category_name=&#38;#39; . $category );
        while( $recent-&#38;gt;have_posts() ) : $recent-&#38;gt;the_post();
          global $post; global $wp_query;
      ?&#38;gt;

      &#38;lt;li class=&#38;quot;clearfix&#38;quot;&#38;gt;
        &#38;lt;?php if( get_post_meta( $post-&#38;gt;ID, &#38;quot;image_value&#38;quot;, true ) ) : ?&#38;gt;

          &#38;lt;div class=&#38;quot;sidebar-preview&#38;quot;&#38;gt;
            &#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot; rel=&#38;quot;bookmark&#38;quot; title=&#38;quot;Permanent Link to &#38;lt;?php the_title_attribute(); ?&#38;gt;&#38;quot;&#38;gt;
              &#38;lt;img src=&#38;quot;&#38;lt;?php bloginfo( &#38;#39;template_directory&#38;#39; ); ?&#38;gt;/timthumb.php?src=&#38;lt;?php echo get_post_meta( $post-&#38;gt;ID, &#38;quot;image_value&#38;quot;, true ); ?&#38;gt;&#38;amp;w=109&#38;amp;h=60&#38;amp;zc=1&#38;quot; alt=&#38;quot;&#38;lt;?php the_title(); ?&#38;gt;&#38;quot; /&#38;gt;
            &#38;lt;/a&#38;gt;
          &#38;lt;/div&#38;gt;

        &#38;lt;?php endif; ?&#38;gt;
        &#38;lt;div class=&#38;quot;sidebar-content&#38;quot;&#38;gt;
          &#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot; rel=&#38;quot;bookmark&#38;quot; title=&#38;quot;Permanent Link to &#38;lt;?php the_title_attribute(); ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/a&#38;gt;
          &#38;lt;span&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink(); ?&#38;gt;/#comments&#38;quot; title=&#38;quot;Read Comments&#38;quot;&#38;gt;&#38;lt;?php comments_number(&#38;#39;0 Comments&#38;#39;, &#38;#39;1 Comment&#38;#39;, &#38;#39;% Comments&#38;#39; );?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/span&#38;gt;
        &#38;lt;/div&#38;gt;
      &#38;lt;/li&#38;gt;

      &#38;lt;?php
        endwhile;
      ?&#38;gt;

    &#38;lt;/ul&#38;gt;
    &#38;lt;a href=&#38;quot;&#38;lt;?php echo get_category_link( get_cat_id( $category ) ); ?&#38;gt;&#38;quot; class=&#38;quot;sidebar-read-more&#38;quot;&#38;gt;Read More »&#38;lt;/a&#38;gt;
  &#38;lt;/li&#38;gt;

&#38;lt;?php

}

function featured_news_admin() {

  $settings = get_option( &#38;#39;widget_featured_news&#38;#39; );

  if( isset( $_POST[ &#38;#39;update_featured_news&#38;#39; ] ) ) {
    $settings[ &#38;#39;number&#38;#39; ] = strip_tags( stripslashes( $_POST[ &#38;#39;widget_featured_news_number&#38;#39; ] ) );
    $settings[ &#38;#39;category&#38;#39; ] = strip_tags( stripslashes( $_POST[ &#38;#39;widget_featured_news_category&#38;#39; ] ) );

    update_option( &#38;#39;widget_featured_news&#38;#39;, $settings );
  }
?&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_featured_news_number&#38;quot;&#38;gt;How many items would you like to display?&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;select id=&#38;quot;widget_featured_news_number&#38;quot; name=&#38;quot;widget_featured_news_number&#38;quot;&#38;gt;
      &#38;lt;?php
        $settings = get_option( &#38;#39;widget_featured_news&#38;#39; );
        $number = $settings[ &#38;#39;number&#38;#39; ];

        $numbers = array( &#38;quot;1&#38;quot;, &#38;quot;2&#38;quot;, &#38;quot;3&#38;quot;, &#38;quot;4&#38;quot;, &#38;quot;5&#38;quot;, &#38;quot;6&#38;quot;, &#38;quot;7&#38;quot;, &#38;quot;8&#38;quot;, &#38;quot;9&#38;quot;, &#38;quot;10&#38;quot; );
        foreach ($numbers as $num ) {
          $option = &#38;#39;&#38;lt;option value=&#38;quot;&#38;#39; . $num . &#38;#39;&#38;quot; &#38;#39; . ( $number == $num? &#38;quot; selected=\&#38;quot;selected\&#38;quot;&#38;quot; : &#38;quot;&#38;quot;) . &#38;#39;&#38;gt;&#38;#39;;
            $option .= $num;
          $option .= &#38;#39;&#38;lt;/option&#38;gt;&#38;#39;;
          echo $option;
        }
      ?&#38;gt;
    &#38;lt;/select&#38;gt;
  &#38;lt;/p&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_featured_news_category&#38;quot;&#38;gt;Which Category is Featured?&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;select id=&#38;quot;widget_featured_news_category&#38;quot; name=&#38;quot;widget_featured_news_category&#38;quot;&#38;gt;
      &#38;lt;?php
        $settings = get_option( &#38;#39;widget_featured_news&#38;#39; );
        $category = $settings[ &#38;#39;category&#38;#39; ];

        $categories= get_categories();
        foreach ($categories as $cat) {
          $option = &#38;#39;&#38;lt;option value=&#38;quot;&#38;#39;.$cat-&#38;gt;cat_name.&#38;#39;&#38;quot; &#38;#39; . ( $category == $cat-&#38;gt;category_nicename ? &#38;quot; selected=\&#38;quot;selected\&#38;quot;&#38;quot; : &#38;quot;&#38;quot;) . &#38;#39;&#38;gt;&#38;#39;;
            $option .= $cat-&#38;gt;cat_name;
          $option .= &#38;#39;&#38;lt;/option&#38;gt;&#38;#39;;
          echo $option;
        }
      ?&#38;gt;
    &#38;lt;/select&#38;gt;
  &#38;lt;/p&#38;gt;
  &#38;lt;input type=&#38;quot;hidden&#38;quot; id=&#38;quot;update_featured_news&#38;quot; name=&#38;quot;update_featured_news&#38;quot; value=&#38;quot;1&#38;quot; /&#38;gt;

&#38;lt;?php

}

/* Recent News Widget
/* ----------------------------------------------*/  

function recent_news() {

  $settings = get_option( &#38;#39;widget_recent_news&#38;#39; );
  $number = $settings[ &#38;#39;number&#38;#39; ];
  $home = $settings[ &#38;#39;home&#38;#39; ];

  if( is_front_page() ) {
    if( $home == &#38;quot;Yes&#38;quot; ) {
      $show = true;
    } else {
      $show = false;
    }
  } else {
    $show = true;
  }

?&#38;gt;

  &#38;lt;?php if( $show ) : ?&#38;gt;

  &#38;lt;li id=&#38;quot;recent-news&#38;quot;&#38;gt;&#38;lt;h5&#38;gt;Recent News&#38;lt;/h5&#38;gt;
    &#38;lt;ul&#38;gt;

      &#38;lt;?php
        $recent = new WP_Query( &#38;#39;showposts=&#38;#39; . $number );
        while( $recent-&#38;gt;have_posts() ) : $recent-&#38;gt;the_post();
          global $post; global $wp_query;
      ?&#38;gt;

      &#38;lt;li class=&#38;quot;clearfix&#38;quot;&#38;gt;
        &#38;lt;?php if( get_post_meta( $post-&#38;gt;ID, &#38;quot;image_value&#38;quot;, true ) ) : ?&#38;gt;

          &#38;lt;div class=&#38;quot;sidebar-preview&#38;quot;&#38;gt;
            &#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot; rel=&#38;quot;bookmark&#38;quot; title=&#38;quot;Permanent Link to &#38;lt;?php the_title_attribute(); ?&#38;gt;&#38;quot;&#38;gt;
              &#38;lt;img src=&#38;quot;&#38;lt;?php bloginfo( &#38;#39;template_directory&#38;#39; ); ?&#38;gt;/timthumb.php?src=&#38;lt;?php echo get_post_meta( $post-&#38;gt;ID, &#38;quot;image_value&#38;quot;, true ); ?&#38;gt;&#38;amp;w=109&#38;amp;h=60&#38;amp;zc=1&#38;quot; alt=&#38;quot;&#38;lt;?php the_title(); ?&#38;gt;&#38;quot; /&#38;gt;
            &#38;lt;/a&#38;gt;
          &#38;lt;/div&#38;gt;

        &#38;lt;?php endif; ?&#38;gt;
        &#38;lt;div class=&#38;quot;sidebar-content&#38;quot;&#38;gt;
          &#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink() ?&#38;gt;&#38;quot; rel=&#38;quot;bookmark&#38;quot; title=&#38;quot;Permanent Link to &#38;lt;?php the_title_attribute(); ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/a&#38;gt;
          &#38;lt;span&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink(); ?&#38;gt;/#comments&#38;quot; title=&#38;quot;Read Comments&#38;quot;&#38;gt;&#38;lt;?php comments_number(&#38;#39;0 Comments&#38;#39;, &#38;#39;1 Comment&#38;#39;, &#38;#39;% Comments&#38;#39; );?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/span&#38;gt;
        &#38;lt;/div&#38;gt;
      &#38;lt;/li&#38;gt;

      &#38;lt;?php
        endwhile;
      ?&#38;gt;

    &#38;lt;/ul&#38;gt;
    &#38;lt;a href=&#38;quot;&#38;lt;?php bloginfo( &#38;#39;rss2_url&#38;#39; ); ?&#38;gt;&#38;quot; class=&#38;quot;sidebar-read-more-rss&#38;quot;&#38;gt;RSS Feed »&#38;lt;/a&#38;gt;
  &#38;lt;/li&#38;gt;

  &#38;lt;?php endif; ?&#38;gt;

&#38;lt;?php

}

function recent_news_admin() {

  $settings = get_option( &#38;#39;widget_recent_news&#38;#39; );

  if( isset( $_POST[ &#38;#39;update_recent_news&#38;#39; ] ) ) {
    $settings[ &#38;#39;number&#38;#39; ] = strip_tags( stripslashes( $_POST[ &#38;#39;widget_recent_news_number&#38;#39; ] ) );
    $settings[ &#38;#39;home&#38;#39; ] = strip_tags( stripslashes( $_POST[ &#38;#39;widget_recent_news_home&#38;#39; ] ) );

    update_option( &#38;#39;widget_recent_news&#38;#39;, $settings );
  }
?&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_recent_news_number&#38;quot;&#38;gt;How many items would you like to display?&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;select id=&#38;quot;widget_recent_news_number&#38;quot; name=&#38;quot;widget_recent_news_number&#38;quot;&#38;gt;
      &#38;lt;?php
        $settings = get_option( &#38;#39;widget_recent_news&#38;#39; );
        $number = $settings[ &#38;#39;number&#38;#39; ];

        $numbers = array( &#38;quot;1&#38;quot;, &#38;quot;2&#38;quot;, &#38;quot;3&#38;quot;, &#38;quot;4&#38;quot;, &#38;quot;5&#38;quot;, &#38;quot;6&#38;quot;, &#38;quot;7&#38;quot;, &#38;quot;8&#38;quot;, &#38;quot;9&#38;quot;, &#38;quot;10&#38;quot; );
        foreach ($numbers as $num ) {
          $option = &#38;#39;&#38;lt;option value=&#38;quot;&#38;#39; . $num . &#38;#39;&#38;quot; &#38;#39; . ( $number == $num? &#38;quot; selected=\&#38;quot;selected\&#38;quot;&#38;quot; : &#38;quot;&#38;quot;) . &#38;#39;&#38;gt;&#38;#39;;
            $option .= $num;
          $option .= &#38;#39;&#38;lt;/option&#38;gt;&#38;#39;;
          echo $option;
        }
      ?&#38;gt;
    &#38;lt;/select&#38;gt;
  &#38;lt;/p&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_recent_recent_home&#38;quot;&#38;gt;Show on Homepage?&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;select id=&#38;quot;widget_recent_recent_home&#38;quot; name=&#38;quot;widget_recent_news_home&#38;quot;&#38;gt;
      &#38;lt;?php
        $settings = get_option( &#38;#39;widget_recent_news&#38;#39; );
        $home = $settings[ &#38;#39;home&#38;#39; ];

        $options = array( &#38;quot;Yes&#38;quot;, &#38;quot;No&#38;quot; );
        foreach( $options as $op ) {
          $option = &#38;#39;&#38;lt;option value=&#38;quot;&#38;#39; . $op . &#38;#39;&#38;quot; &#38;#39; . ( $home == $op ? &#38;quot; selected=\&#38;quot;selected\&#38;quot;&#38;quot; : &#38;quot;&#38;quot;) . &#38;#39;&#38;gt;&#38;#39;;
            $option .= $op;
          $option .= &#38;#39;&#38;lt;/option&#38;gt;&#38;#39;;
          echo $option;
        }
      ?&#38;gt;
    &#38;lt;/select&#38;gt;
  &#38;lt;/p&#38;gt;
  &#38;lt;input type=&#38;quot;hidden&#38;quot; id=&#38;quot;update_recent_news&#38;quot; name=&#38;quot;update_recent_news&#38;quot; value=&#38;quot;1&#38;quot; /&#38;gt;

&#38;lt;?php

}

/* Sponsored Ad Widget
/* ----------------------------------------------*/  

function sponsored_ad() {

  $settings = get_option( &#38;#39;widget_sponsored_ad&#38;#39; );
  $code = $settings[ &#38;#39;code&#38;#39; ];
  $title = $settings[ &#38;#39;title&#38;#39; ];

?&#38;gt;

  &#38;lt;li id=&#38;quot;sponsored-ad&#38;quot;&#38;gt;
    &#38;lt;p class=&#38;quot;sponsored-ad&#38;quot;&#38;gt;&#38;lt;?php echo $title; ?&#38;gt;&#38;lt;/p&#38;gt;

    &#38;lt;?php echo $code; ?&#38;gt;
  &#38;lt;/li&#38;gt;&#38;lt;!-- End sponsored-ad --&#38;gt;

&#38;lt;?php

}

function sponsored_ad_admin() {

  $settings = get_option( &#38;#39;widget_sponsored_ad&#38;#39; );

  if( isset( $_POST[ &#38;#39;widget_sponsored_ad&#38;#39; ] ) ) {
    $settings[ &#38;#39;code&#38;#39; ] = stripslashes( $_POST[ &#38;#39;widget_code&#38;#39; ] );
    $settings[ &#38;#39;title&#38;#39; ] = strip_tags( stripslashes( $_POST[ &#38;#39;widget_code_title&#38;#39; ] ) );
    update_option( &#38;#39;widget_sponsored_ad&#38;#39;, $settings );
  }

  $settings = get_option( &#38;#39;widget_sponsored_ad&#38;#39; );
  $code = $settings[ &#38;#39;code&#38;#39; ];
  $title = $settings[ &#38;#39;title&#38;#39; ];
?&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_code_title&#38;quot;&#38;gt;Ad Titles&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;input type=&#38;quot;text&#38;quot; name=&#38;quot;widget_code_title&#38;quot; id+&#38;quot;widget_code_title&#38;quot; value=&#38;quot;&#38;lt;?php echo $title; ?&#38;gt;&#38;quot; /&#38;gt;
  &#38;lt;p&#38;gt;
    &#38;lt;label for=&#38;quot;widget_code&#38;quot;&#38;gt;Place Ad Code Below:&#38;lt;/label&#38;gt;&#38;lt;br /&#38;gt;
    &#38;lt;textarea name=&#38;quot;widget_code&#38;quot; id=&#38;quot;widget_code&#38;quot; cols=&#38;quot;&#38;quot; rows=&#38;quot;6&#38;quot; style=&#38;quot;width:290px;&#38;quot;&#38;gt;&#38;lt;?php echo $code; ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>

</channel>
</rss>
