Results 1 to 2 of 2

Thread: Popular Ads - adding city and state to the widget

  1. #1
    Thread Starter
    Member dschn1978's Avatar
    Join Date
    Jul 2010
    Location
    United States
    Posts
    53
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Popular Ads - adding city and state to the widget

    How do I add the city and state to the popular ad widget...please help...

    // classipress sidebar top ads widget
    class CP_Widget_Top_Ads_Today extends WP_Widget {

    function CP_Widget_Top_Ads_Today() {
    $widget_ops = array( 'description' => __( 'Your sidebar top ads today', 'appthemes') );
    $this->WP_Widget('top_ads', 'CP ' . __('Top Ads Today', 'appthemes'), $widget_ops);
    }

    function widget( $args, $instance ) {

    extract($args);
    $title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Ads Today', 'appthemes') : $instance['title']);

    echo $before_widget;
    if ( $title )
    echo $before_title . $title . $after_title;

    cp_todays_count_widget('ad_listing', 10);

    echo $after_widget;
    }

    function update($new_instance, $old_instance) {
    $instance['title'] = strip_tags(stripslashes($new_instance['title']));
    return $instance;
    }

    function form($instance) {
    ?>
    <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'appthemes') ?></label>
    <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ($instance['title'])) {echo esc_attr( $instance['title']);} ?>" /></p>
    <?php
    }
    }

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    41,009
    Thanks
    170
    Thanked 3,409 Times in 3,280 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding search via Country, State and City
    By vistago in forum ClassiPress General Discussion
    Replies: 11
    Last Post: October 11th, 2013, 09:15 PM
  2. How to post by city or state
    By ncalderone in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: January 1st, 2011, 12:15 AM
  3. Adding search via Country, State and City
    By vistago in forum Help Using ClassiPress
    Replies: 0
    Last Post: December 31st, 1969, 07:00 PM