Community Forums › Forums › Archived Forums › General Discussion › AgentPress Question
- This topic has 7 replies, 2 voices, and was last updated 10 years ago by RMS.
-
AuthorPosts
-
April 26, 2014 at 9:43 am #102437RMSMember
Hello,
I would like to change the search button's wording on the top of our page from "Search Properties" to "Search Inventory", but cannot find where to do so in the editor. Any help would be appreciated. Thanks!
https://www.raysmotorsales.com/?s=&post_type=listing&make=&model=&type=&yearmodel=
http:// https://www.raysmotorsales.com/?s=&post_type=listing&make=&model=&type=&yearmodel=April 26, 2014 at 11:14 am #102463AnitaKeymasterWell, because I know what I am doing most of the time (LOL), I modified the plugin directly. I went to Plugins > Editors. Selected the plugin from the drop down on the right and there is a link for - class-property-search-widget.php. If you open that you will see where Search Properties is located and you can change it there. What I would suggest however, as I do this automatically by default and as good practice - download the plugin from here and keep it handy on your hard drive.
Love coffee, chocolate and my Bella!
April 26, 2014 at 11:41 am #102476RMSMemberThat was very helpful. Didn't even know it existed, like I said, I am novice at this stuff, but learning. I changed the text from properties to inventory. But it still shows "properties" on the button. Thanks again for your help! Here's the file I edited:
<?php
/**
* This widget presents a search widget which uses listings' taxonomy for search fields.
*
* @package AgentPress
* @since 2.0
* @author Ron Rennick
*/
class AgentPress_Listings_Search_Widget extends WP_Widget {function AgentPress_Listings_Search_Widget() {
$widget_ops = array( 'classname' => 'property-search', 'description' => __( 'Display property search dropdown', 'apl' ) );
$control_ops = array( 'width' => 200, 'height' => 250, 'id_base' => 'property-search' );
$this->WP_Widget( 'property-search', __( 'AgentPress - Listing Search', 'apl' ), $widget_ops, $control_ops );
}function widget( $args, $instance ) {
$instance = wp_parse_args( (array) $instance, array(
'title' => '',
'button_text' => __( 'Search Inventory', 'apl' )
) );global $_agentpress_taxonomies;
$listings_taxonomies = $_agentpress_taxonomies->get_taxonomies();
extract( $args );
echo $before_widget;
if ( $instance['title'] ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
echo '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" ><input type="hidden" value="" name="s" /><input type="hidden" value="listing" name="post_type" />';
foreach ( $listings_taxonomies as $tax => $data ) {
if ( ! isset( $instance[$tax] ) || ! $instance[$tax] )
continue;$terms = get_terms( $tax, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 100, 'hierarchical' => false ) );
if ( empty( $terms ) )
continue;$current = ! empty( $wp_query->query_vars[$tax] ) ? $wp_query->query_vars[$tax] : '';
echo "<select name='$tax' id='$tax' class='agentpress-taxonomy'>\n\t";
echo '<option value="" ' . selected( $current == '', true, false ) . ">{$data['labels']['name']}</option>\n";
foreach ( (array) $terms as $term )
echo "\t<option value='{$term->slug}' " . selected( $current, $term->slug, false ) . ">{$term->name}</option>\n";echo '</select>';
}echo '<input type="submit" id="searchsubmit" class="searchsubmit" value="'. esc_attr( $instance['button_text'] ) .'" />
<div class="clear"></div>
</form>';echo $after_widget;
}
function update( $new_instance, $old_instance ) {
return $new_instance;
}function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array(
'title' => '',
'button_text' => __( 'Search Inventory', 'apl' )
) );global $_agentpress_taxonomies;
$listings_taxonomies = $_agentpress_taxonomies->get_taxonomies();
$new_widget = empty( $instance );printf( '<p><label for="%s">%s</label><input type="text" id="%s" name="%s" value="%s" style="%s" /></p>', $this->get_field_id( 'title' ), __( 'Title:', 'apl' ), $this->get_field_id( 'title' ), $this->get_field_name( 'title' ), esc_attr( $instance['title'] ), 'width: 95%;' );
?>
<h5><?php _e( 'Include these taxonomies in the search widget', 'apl' ); ?></h5>
<?php
foreach ( (array) $listings_taxonomies as $tax => $data ) {
$terms = get_terms( $tax );
if ( empty( $terms ) )
continue;
?>
<p><label><input id="<?php echo $this->get_field_id( $tax ); ?>" type="checkbox" name="<?php echo $this->get_field_name( $tax ); ?>" value="1" <?php checked( 1, $instance[$tax] || $new_widget ); ?>/> <?php echo $data['labels']['name']; ?></label></p>
<?php
}printf( '<p><label for="%s">%s</label><input type="text" id="%s" name="%s" value="%s" style="%s" /></p>', $this->get_field_id( 'button_text' ), __( 'Button Text:', 'apl' ), $this->get_field_id( 'button_text' ), $this->get_field_name( 'button_text' ), esc_attr( $instance['button_text'] ), 'width: 95%;' );
}
}April 26, 2014 at 11:45 am #102479AnitaKeymasterI see a caching plugin. Clear your cache.
Love coffee, chocolate and my Bella!
April 28, 2014 at 9:29 am #102733RMSMemberForgive my ignorance, but how would I do that?
April 28, 2014 at 9:29 am #102734RMSMemberAnd thank you, you have been very, very helpful!
April 28, 2014 at 9:38 am #102738AnitaKeymasterIt's located in your dashboard somewhere under your plugins and dashboard navigation.
Love coffee, chocolate and my Bella!
April 30, 2014 at 7:50 am #103060RMSMemberThanks for the answer, I couldn't figure it out, so it will have to stay "Search Properties" for now.
Another question: Is there a way that I can get the images that show in the slider to shrink to fit the whole image in the slider automatically?
Thanks in advance!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.