• jonnysmyth13

    (@jonnysmyth13)


    Hello,

    Trying to edit some php in WordPress for this site.
    There is for example a typo of ‘LASTEST’ on this page it should be ‘LATEST’, change the code in WordPress hit update no change!

    Updated all the apps, and WP, and updated the PHP version on the Host, still no change.

    Does anyone have any ideas??

    Thanks for you help.

    Jonny

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Farook Kholwadia

    (@judgerookie)

    unsure why text would be in a PHP file?

    browser inspector suggests it’s a widget title?

    can we assume you’ve looked in widgets?

    can you expand a little?

    for example, which PHP file?

    Thread Starter jonnysmyth13

    (@jonnysmyth13)

    This is the widget.php file….

    <?php
    
    /*******************************************
     * search
     *******************************************/
    class montana_search_widget extends WP_Widget {
    
    	function montana_search_widget() {
    		//Constructor
    		$widget_ops = array( 'classname' => 'montana_search_widget', 'description' => 'A search form for your site.' );
    		$this->WP_Widget( 'widget_montana_search_widget', 'Montana: Search on Page', $widget_ops );
    	}
    
    	function widget( $args, $instance ) {
    		extract( $args, EXTR_SKIP );
    		$class_custom = empty( $instance['class_custom'] ) ? '' : apply_filters( 'widget_class_custom', $instance['class_custom'] );
    		$style        = empty( $instance['style'] ) ? '' : apply_filters( 'widget_style', $instance['style'] );
    
    		echo $before_widget;
    		if ( $style == 'style1' ) {
    			?>
    			<div class="main-header-search search_form <?php echo $class_custom; ?>">
    				<a><i class="fa fa-search"></i></a>
     			</div>
    		<?php } else { ?>
    
    			<div class="main-nav-search search_form <?php echo $class_custom; ?>">
    				<a><i class="fa fa-search"></i></a>
    				<div id="nav-search-form" class="main-nav-search-form">
    					<form role="search" method="get" action="<?php echo home_url( '/' ); ?>">
    						<input type="text" value="" name="s" id="s" placeholder="<?php echo __( 'Search...', 'montana' ); ?>" class="search-input" />
    						<input type="submit" id="searchsubmit" value="" />
    					</form>
    				</div>
    			</div>
    		<?php
    		}
    		echo $after_widget;
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance                 = $old_instance;
    		$instance['class_custom'] = strip_tags( $new_instance['class_custom'] );
    		$instance['style']        = strip_tags( $new_instance['style'] );
    
    		return $instance;
    	}
    
    	function form( $instance ) {
    		$instance     = wp_parse_args( (array) $instance, array( 'class_custom' => '', 'style' => '' ) );
    		$class_custom = strip_tags( $instance['class_custom'] );
    		$style        = strip_tags( $instance['style'] );
    		?>
    		<p><label for="<?php echo $this->get_field_id( 'style' ); ?>">Select Style
    				<select name="<?php echo $this->get_field_name( 'style' ); ?>" id="<?php echo $this->get_field_id( 'style' ); ?>" >
    					<?php
    					if ( $style == 'style1' ) {
    						echo '<option value="style1" selected="selected">Style 1</option>';
    					} else {
    						echo '<option value="style1">Style 1</option>';
    					}
    					if ( $style == 'style2' ) {
    						echo '<option value="style2" selected="selected">Style 2</option>';
    					} else {
    						echo '<option value="style2">Style 2</option>';
    					}
    					?>
    				</select>
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'class_custom' ); ?>"><?php _e( 'Css Class:', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'class_custom' ); ?>" name="<?php echo $this->get_field_name( 'class_custom' ); ?>" value="<?php echo esc_attr( $class_custom ); ?>">
    		</p>
    
    	<?php
    	}
    }
    
    register_widget( 'montana_search_widget' );
    
    /********************************************************************
     * Flickr Photos
     ********************************************************************/
    class flickrWidget extends WP_Widget {
    	function flickrWidget() {
    		$widget_ops = array( 'classname' => 'flickr', 'description' => 'Flickr Photos' );
    		$this->WP_Widget( 'widget_flickrwidget', 'Montana: Flickr', $widget_ops );
    	}
    
    	function widget( $args, $instance ) {
    		extract( $args, EXTR_SKIP );
    		$title_1      = empty( $instance['title_1'] ) ? '&nbsp;' : apply_filters( 'widget_title', $instance['title_1'] );
    		$id           = empty( $instance['id'] ) ? '&nbsp;' : apply_filters( 'widget_id', $instance['id'] );
    		$number       = empty( $instance['number'] ) ? '&nbsp;' : apply_filters( 'widget_number', $instance['number'] );
    		$class_custom = empty( $instance['class_custom'] ) ? '' : apply_filters( 'widget_class_custom', $instance['class_custom'] );
    		echo $before_widget;
    		?>
    		<?php if ( $class_custom <> '' ) {
    			echo '<div class="' . $class_custom . '">';
    		} ?>
    		<?php
    		if ( $title_1 ) {
    			echo $before_title . $title_1 . $after_title;
    		}?>
    		<div>
    			<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $number; ?>&display=latest&size=s&source=user&user=<?php echo $id; ?>"></script>
    		</div>
    		<?php if ( $class_custom <> '' ) {
    			echo '</div>';
    		} ?>
    
    		<?php
    		echo $after_widget;
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance                 = $old_instance;
    		$instance['title_1']      = strip_tags( $new_instance['title_1'] );
    		$instance['id']           = strip_tags( $new_instance['id'] );
    		$instance['number']       = strip_tags( $new_instance['number'] );
    		$instance['class_custom'] = strip_tags( $new_instance['class_custom'] );
    
    		return $instance;
    	}
    
    	function form( $instance ) {
    		$instance     = wp_parse_args( (array) $instance, array( 'title_1' => 'Flickr Photos', 'id' => '39613017@N07', 'number' => '6', 'class_custom' => ' ' ) );
    		$title_1      = strip_tags( $instance['title_1'] );
    		$id           = strip_tags( $instance['id'] );
    		$number       = strip_tags( $instance['number'] );
    		$class_custom = strip_tags( $instance['class_custom'] );
    		?>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'title_1' ); ?>"><?php _e( 'Title', 'montana' ) ?>:
    				<input class="widefat" id="<?php echo $this->get_field_id( 'title_1' ); ?>" name="<?php echo $this->get_field_name( 'title_1' ); ?>" type="text" value="<?php echo esc_attr( $title_1 ); ?>" />
    			</label>
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php _e( 'Flickr ID (<a href="http://www.idgettr.com">idGettr</a>)', 'montana' ) ?>:
    				<input class="widefat" id="<?php echo $this->get_field_id( 'id' ); ?>" name="<?php echo $this->get_field_name( 'id' ); ?>" type="text" value="<?php echo esc_attr( $id ); ?>" />
    			</label>
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of photos:', 'montana' ) ?>
    				<input class="widefat" id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" />
    			</label>
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'class_custom' ); ?>"><?php _e( 'Css Class:', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'class_custom' ); ?>" name="<?php echo $this->get_field_name( 'class_custom' ); ?>" value="<?php echo esc_attr( $class_custom ); ?>">
    		</p>
    	<?php
    	}
    }
    
    register_widget( 'flickrWidget' );
    
    /********************************************************************
     * montana_social_links
     ********************************************************************/
    class social_links extends WP_Widget {
    	function social_links() {
    		$widget_ops = array( 'classname' => 'montana_social_links', 'description' => 'Social Links' );
    		$this->WP_Widget( 'widget_social_links', 'Montana: Social Links', $widget_ops );
    	}
    
    	function widget( $args, $instance ) {
    		extract( $args, EXTR_SKIP );
    		$title          = empty( $instance['title'] ) ? '' : apply_filters( 'widget_title', $instance['title'] );
    		$link_face      = empty( $instance['link_face'] ) ? '' : apply_filters( 'widget_link_face', $instance['link_face'] );
    		$link_twitter   = empty( $instance['link_twitter'] ) ? '' : apply_filters( 'widget_link_twitter', $instance['link_twitter'] );
    		$link_google    = empty( $instance['link_google'] ) ? '' : apply_filters( 'widget_link_google', $instance['link_google'] );
    		$link_dribble   = empty( $instance['link_dribble'] ) ? '' : apply_filters( 'widget_link_dribble', $instance['link_dribble'] );
    		$link_linkedin  = empty( $instance['link_linkedin'] ) ? '' : apply_filters( 'widget_link_linkedin', $instance['link_linkedin'] );
    		$link_pinterest = empty( $instance['link_pinterest'] ) ? '' : apply_filters( 'widget_link_pinterest', $instance['link_pinterest'] );
    		$link_digg      = empty( $instance['link_digg'] ) ? '' : apply_filters( 'widget_link_digg', $instance['link_digg'] );
    		$link_youtube   = empty( $instance['link_youtube'] ) ? '' : apply_filters( 'widget_link_youtube', $instance['link_youtube'] );
    		$class_custom   = empty( $instance['class_custom'] ) ? '' : apply_filters( 'widget_class_custom', $instance['class_custom'] );
    		echo $before_widget;
    		?>
    		<?php if ( $class_custom <> '' ) {
    			echo '<div class="' . $class_custom . '">';
    		}
    		if ( $title ) {
    			echo $before_title . $title . $after_title;
    		}?>
    		<ul class="montana_social_link">
    			<?php
    			if ( $link_face != '' ) {
    				echo '<li><a href="' . $link_face . '" title="' . __( 'Facebook', 'montana' ) . '"><i class="fa fa-facebook-square"></i></a></li>';
    			}
    			if ( $link_twitter != '' ) {
    				echo '<li><a href="' . $link_twitter . '" title="' . __( 'Twitter', 'montana' ) . '"><i class="fa fa-twitter"></i></a></li>';
    			}
    			if ( $link_google != '' ) {
    				echo '<li><a href="' . $link_google . '" title="' . __( 'Google', 'montana' ) . '"><i class="fa fa-google-plus"></i></a></li>';
    			}
    			if ( $link_dribble != '' ) {
    				echo '<li><a href="' . $link_dribble . '" title="' . __( 'Dribble', 'montana' ) . '"><i class="fa fa-dribbble"></i></a></li>';
    			}
    			if ( $link_linkedin != '' ) {
    				echo '<li><a href="' . $link_linkedin . '" title="' . __( 'Linkedin', 'montana' ) . '"><i class="fa fa-linkedin"></i></a></li>';
    			}
    
    			if ( $link_pinterest != '' ) {
    				echo '<li><a href="' . $link_pinterest . '" title="' . __( 'Pinterest', 'montana' ) . '"><i class="fa fa-pinterest"></i></a></li>';
    			}
    			if ( $link_digg != '' ) {
    				echo '<li><a href="' . $link_digg . '" title="' . __( 'Digg', 'montana' ) . '"><i class="fa fa-digg"></i></a></li>';
    			}
    			if ( $link_youtube != '' ) {
    				echo '<li><a href="' . $link_youtube . '" title="' . __( 'Youtube', 'montana' ) . '"><i class="fa fa-youtube"></i></a></li>';
    			}
    			?>
    		</ul>
    
    		<?php if ( $class_custom <> '' ) {
    			echo '</div>';
    		} ?>
    
    		<?php
    		echo $after_widget;
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance                   = $old_instance;
    		$instance['title']          = strip_tags( $new_instance['title'] );
    		$instance['link_face']      = strip_tags( $new_instance['link_face'] );
    		$instance['link_twitter']   = strip_tags( $new_instance['link_twitter'] );
    		$instance['link_google']    = strip_tags( $new_instance['link_google'] );
    		$instance['link_dribble']   = strip_tags( $new_instance['link_dribble'] );
    		$instance['link_linkedin']  = strip_tags( $new_instance['link_linkedin'] );
    		$instance['link_pinterest'] = strip_tags( $new_instance['link_pinterest'] );
    		$instance['link_digg']      = strip_tags( $new_instance['link_digg'] );
    		$instance['link_youtube']   = strip_tags( $new_instance['link_youtube'] );
    		$instance['class_custom']   = strip_tags( $new_instance['class_custom'] );
    
    		return $instance;
    	}
    
    	function form( $instance ) {
    		$instance       = wp_parse_args( (array) $instance, array( 'title' => '', 'link_face' => '', 'link_twitter' => '', 'link_google' => '', 'link_dribble' => '', 'link_linkedin' => '', 'link_pinterest' => '', 'link_digg' => '', 'link_youtube' => '', 'class_custom' => '' ) );
    		$title          = strip_tags( $instance['title'] );
    		$link_face      = strip_tags( $instance['link_face'] );
    		$link_twitter   = strip_tags( $instance['link_twitter'] );
    		$link_google    = strip_tags( $instance['link_google'] );
    		$link_dribble   = strip_tags( $instance['link_dribble'] );
    		$link_linkedin  = strip_tags( $instance['link_linkedin'] );
    		$link_pinterest = strip_tags( $instance['link_pinterest'] );
    		$link_digg      = strip_tags( $instance['link_digg'] );
    		$link_youtube   = strip_tags( $instance['link_youtube'] );
    		$class_custom   = strip_tags( $instance['class_custom'] );
    		?>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php echo _e( 'Title: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_face' ); ?>"><?php echo _e( 'Facebook Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_face' ); ?>" name="<?php echo $this->get_field_name( 'link_face' ); ?>" value="<?php echo esc_attr( $link_face ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_twitter' ); ?>"><?php echo _e( 'Twitter Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_twitter' ); ?>" name="<?php echo $this->get_field_name( 'link_twitter' ); ?>" value="<?php echo esc_attr( $link_twitter ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_google' ); ?>"><?php echo _e( 'Google Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_google' ); ?>" name="<?php echo $this->get_field_name( 'link_google' ); ?>" value="<?php echo esc_attr( $link_google ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_dribble' ); ?>"><?php echo _e( 'Dribble Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_dribble' ); ?>" name="<?php echo $this->get_field_name( 'link_dribble' ); ?>" value="<?php echo esc_attr( $link_dribble ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_linkedin' ); ?>"><?php echo _e( 'Linkedin Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_linkedin' ); ?>" name="<?php echo $this->get_field_name( 'link_linkedin' ); ?>" value="<?php echo esc_attr( $link_linkedin ); ?>">
    		</p>
    
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_pinterest' ); ?>"><?php echo _e( 'pinterest Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_pinterest' ); ?>" name="<?php echo $this->get_field_name( 'link_pinterest' ); ?>" value="<?php echo esc_attr( $link_pinterest ); ?>">
    		</p>
    
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_digg' ); ?>"><?php echo _e( 'Digg Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_digg' ); ?>" name="<?php echo $this->get_field_name( 'link_digg' ); ?>" value="<?php echo esc_attr( $link_digg ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'link_youtube' ); ?>"><?php echo _e( 'Youtube Url: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'link_youtube' ); ?>" name="<?php echo $this->get_field_name( 'link_youtube' ); ?>" value="<?php echo esc_attr( $link_youtube ); ?>">
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id( 'class_custom' ); ?>"><?php echo _e( 'Css Class: ', 'montana' ) ?> </label>
    			<input type="text" class="widefat" size="3" id="<?php echo $this->get_field_id( 'class_custom' ); ?>" name="<?php echo $this->get_field_name( 'class_custom' ); ?>" value="<?php echo esc_attr( $class_custom ); ?>">
    		</p>
    
    	<?php
    	}
    }
    
    register_widget( 'social_links' );
    Moderator bcworkz

    (@bcworkz)

    What judgerookie is getting at is the “LASTEST” is coming from widget data. The widget data is separate from the widget code.

    Go to the widgets admin screen (Appearance > Widgets). Find the specific widget that has the erroneous title and correct it, then click save at the bottom of the widget form. The widget you want will have LASTEST PROJECTS in its title field.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Simply trying to correct a typo in PHP’ is closed to new replies.