Sydney FP: Latest news

I am using Sydney wordpress theme and its widgets. Tried to add latest blog post widget for my front page, but the latest posts keep showing up the same text that is in my in content optin form (Thrives). If I add excerpt manually, everything is OK, however I need automatic excript, because I need to add ‘‘read more’’ etc… My website is relishthegame.com. Could you please check it out? Thanks

Hello @relishthegame,

I’m not sure what is your issue, can you please provide some explanatory screenshots? You can upload screenshots to your WordPress Media Library and share a link, or you can use one of the online screenshot services.

Kind Regards, Roman.

Here is link for my optin page - http://www.relishthegame.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-31-at-00.20.25.png

Here is link for my latest blogs on homepage - http://www.relishthegame.com/wp-content/uploads/2016/12/Screen-Shot-2016-12-31-at-00.16.51-1.png

When I remove optin page, real blogs show up!

Hi,

I tried to get clever and change the contact info CSS to make the phone number - actually call. I already saved the original CSS into notepad. I failed at the change in code- so went and pasted the original code back in- now the entire site has this error (no matter what page or even dashboard I choose to go to)
Parse error: syntax error, unexpected ‘<’ in /home/livingwi/public_html/wp/wp-content/themes/sydney/widgets/contact-info.php on line 89

I have counted down the lines and cannot see the error. So I went to Sydney and downloaded the entire file system again. I re-opened the original code in Notepad and then copied it again into the CSS Editor page - but the same error keeps appearing and I cannot seem to get anywhere else on the site

Here is what is now in the CSS- copied from the downloadable file. Is there anyway to help me- I can’t even seem to get to uninstall plugins, or any admin to even delete and start again?

Here is what I pasted back in after stuffing it:

<?php

class Sydney_Contact_Info extends WP_Widget {

public function __construct() {
	$widget_ops = array('classname' =&gt; 'sydney_contact_info_widget', 'description' =&gt; __( 'Display your contact info', 'sydney') );
    parent::__construct(false, $name = __('Sydney: Contact info', 'sydney'), $widget_ops);
	$this-&gt;alt_option_name = 'sydney_contact_info';	
}

function form($instance) {

	$title    = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
	$address  = isset( $instance['address'] ) ? esc_html( $instance['address'] ) : '';
	$phone    = isset( $instance['phone'] ) ? esc_html( $instance['phone'] ) : '';
	$email    = isset( $instance['email'] ) ? esc_html( $instance['email'] ) : '';
?&gt;

&lt;p&gt;
&lt;label for="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;"&gt;&lt;?php _e('Title', 'sydney'); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;" type="text" value="&lt;?php echo $title; ?&gt;" /&gt;
&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'address' ); ?&gt;"&gt;&lt;?php _e( 'Enter your address', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'address' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'address' ); ?&gt;" type="text" value="&lt;?php echo $address; ?&gt;" size="3" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'phone' ); ?&gt;"&gt;&lt;?php _e( 'Enter your phone number', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'phone' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'phone' ); ?&gt;" type="text" value="&lt;?php echo $phone; ?&gt;" size="3" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'email' ); ?&gt;"&gt;&lt;?php _e( 'Enter your email address', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'email' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'email' ); ?&gt;" type="text" value="&lt;?php echo $email; ?&gt;" size="3" /&gt;&lt;/p&gt;	

&lt;?php
}

function update($new_instance, $old_instance) {
	$instance = $old_instance;
	$instance['title'] = strip_tags($new_instance['title']);
	$instance['address'] = strip_tags($new_instance['address']);
	$instance['phone'] = strip_tags($new_instance['phone']);
	$instance['email'] = sanitize_email($new_instance['email']);

	$alloptions = wp_cache_get( 'alloptions', 'options' );
	if ( isset($alloptions['sydney_contact_info']) )
		delete_option('sydney_contact_info');		  
	  
	return $instance;
}
	
function widget($args, $instance) {
	$cache = array();
	if ( ! $this-&gt;is_preview() ) {
		$cache = wp_cache_get( 'sydney_contact_info', 'widget' );
	}

	if ( ! is_array( $cache ) ) {
		$cache = array();
	}

	if ( ! isset( $args['widget_id'] ) ) {
		$args['widget_id'] = $this-&gt;id;
	}

	if ( isset( $cache[ $args['widget_id'] ] ) ) {
		echo $cache[ $args['widget_id'] ];
		return;
	}

	ob_start();
	extract($args);

	$title 		= ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
	$title 		= apply_filters( 'widget_title', $title, $instance, $this-&gt;id_base );
	$address   	= isset( $instance['address'] ) ? esc_html( $instance['address'] ) : '';
	$phone   	= isset( $instance['phone'] ) ? esc_html( $instance['phone'] ) : '';
	$email   	= isset( $instance['email'] ) ? antispambot(esc_html( $instance['email'] )) : '';

	echo $before_widget;
	
	if ( $title ) echo $before_title . $title . $after_title;
	
	if( ($address) ) {
		echo '&lt;div class="contact-address"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-home"&gt;&lt;/i&gt;&lt;/span&gt;' . $address;
		echo '&lt;/div&gt;';
	}
	if( ($phone) ) {
		echo '&lt;div class="contact-phone"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt;&lt;/span&gt;' . $phone;
		echo '&lt;/div&gt;';
	}
	if( ($email) ) {
		echo '&lt;div class="contact-email"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&lt;/span&gt;' . '<a href="mailto:' . $email . '">' . $email . '</a>';
		echo '&lt;/div&gt;';
	}				

	echo $after_widget;


	if ( ! $this-&gt;is_preview() ) {
		$cache[ $args['widget_id'] ] = ob_get_flush();
		wp_cache_set( 'sydney_contact_info', $cache, 'widget' );
	} else {
		ob_end_flush();
	}
}

}
And then here is what I now pasted back in from the original files

<?php

class Sydney_Contact_Info extends WP_Widget {

public function __construct() {
	$widget_ops = array('classname' =&gt; 'sydney_contact_info_widget', 'description' =&gt; __( 'Display your contact info', 'sydney') );
    parent::__construct(false, $name = __('Sydney: Contact info', 'sydney'), $widget_ops);
	$this-&gt;alt_option_name = 'sydney_contact_info';	
}

function form($instance) {

	$title    = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
	$address  = isset( $instance['address'] ) ? esc_html( $instance['address'] ) : '';
	$phone    = isset( $instance['phone'] ) ? esc_html( $instance['phone'] ) : '';
	$email    = isset( $instance['email'] ) ? esc_html( $instance['email'] ) : '';
?&gt;

&lt;p&gt;
&lt;label for="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;"&gt;&lt;?php _e('Title', 'sydney'); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;" type="text" value="&lt;?php echo $title; ?&gt;" /&gt;
&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'address' ); ?&gt;"&gt;&lt;?php _e( 'Enter your address', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'address' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'address' ); ?&gt;" type="text" value="&lt;?php echo $address; ?&gt;" size="3" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'phone' ); ?&gt;"&gt;&lt;?php _e( 'Enter your phone number', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'phone' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'phone' ); ?&gt;" type="text" value="&lt;?php echo $phone; ?&gt;" size="3" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;label for="&lt;?php echo $this-&gt;get_field_id( 'email' ); ?&gt;"&gt;&lt;?php _e( 'Enter your email address', 'sydney' ); ?&gt;&lt;/label&gt;
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id( 'email' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'email' ); ?&gt;" type="text" value="&lt;?php echo $email; ?&gt;" size="3" /&gt;&lt;/p&gt;	

&lt;?php
}

function update($new_instance, $old_instance) {
	$instance = $old_instance;
	$instance['title'] = strip_tags($new_instance['title']);
	$instance['address'] = strip_tags($new_instance['address']);
	$instance['phone'] = strip_tags($new_instance['phone']);
	$instance['email'] = sanitize_email($new_instance['email']);

	$alloptions = wp_cache_get( 'alloptions', 'options' );
	if ( isset($alloptions['sydney_contact_info']) )
		delete_option('sydney_contact_info');		  
	  
	return $instance;
}
	
function widget($args, $instance) {
	$cache = array();
	if ( ! $this-&gt;is_preview() ) {
		$cache = wp_cache_get( 'sydney_contact_info', 'widget' );
	}

	if ( ! is_array( $cache ) ) {
		$cache = array();
	}

	if ( ! isset( $args['widget_id'] ) ) {
		$args['widget_id'] = $this-&gt;id;
	}

	if ( isset( $cache[ $args['widget_id'] ] ) ) {
		echo $cache[ $args['widget_id'] ];
		return;
	}

	ob_start();
	extract($args);

	$title 		= ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
	$title 		= apply_filters( 'widget_title', $title, $instance, $this-&gt;id_base );
	$address   	= isset( $instance['address'] ) ? esc_html( $instance['address'] ) : '';
	$phone   	= isset( $instance['phone'] ) ? esc_html( $instance['phone'] ) : '';
	$email   	= isset( $instance['email'] ) ? antispambot(esc_html( $instance['email'] )) : '';

	echo $before_widget;
	
	if ( $title ) echo $before_title . $title . $after_title;
	
	if( ($address) ) {
		echo '&lt;div class="contact-address"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-home"&gt;&lt;/i&gt;&lt;/span&gt;' . $address;
		echo '&lt;/div&gt;';
	}
	if( ($phone) ) {
		echo '&lt;div class="contact-phone"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt;&lt;/span&gt;' . $phone;
		echo '&lt;/div&gt;';
	}
	if( ($email) ) {
		echo '&lt;div class="contact-email"&gt;';
		echo '&lt;span&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&lt;/span&gt;' . '<a href="mailto:' . $email . '">' . $email . '</a>';
		echo '&lt;/div&gt;';
	}				

	echo $after_widget;


	if ( ! $this-&gt;is_preview() ) {
		$cache[ $args['widget_id'] ] = ob_get_flush();
		wp_cache_set( 'sydney_contact_info', $cache, 'widget' );
	} else {
		ob_end_flush();
	}
}

}

Hello @relishthegame, do you use a plugin for your optin page? If yes, please try to deactivate it, that can be a conflict.

@heartofphilosophy, please try to reinstall the theme. By the way, it is better to create your own topic for your question to keep forum in good order.

Kind Regards, Roman.

Yes! When I deactivate Thrive Leads plugin, right blog posts show up. However, I usually use those plugins.

There is one option how I could solve this problem. I can add excerpt manually. Can you please tell me how I could insert ‘‘Read More’’ link after that excerpt? Because it is not added automatically, if I write excerpt text in excerpt window below post.

Hello @relishthegame,

It looks like this issue requires some coding and testing, this goes beyond our support policy. It’s considered advanced customization.

As an option, you can contact Codeable for this kind of service, or find a freelancer on Upwork.

Kind Regards, Roman.

P. S.
If you are familiar with PHP coding then you can try to do it yourself.

Here are relevant functions:
https://developer.wordpress.org/reference/functions/the_content/
https://developer.wordpress.org/reference/functions/the_excerpt/

Maybe you can suggest some alternative plugin to Sydney FP latest news blog posts? Actually, I don’t even need latest blog posts on my front page. I just need three blog posts of my choice to be displayed on the first page. Any suggestions? Thanks

Hello @relishthegame,

Well, you can try to use Recent Posts Widget Extended plugin.

Kind Regards, Roman.

Thanks for your time!

You are welcome @relishthegame! :slight_smile:

Kind Regards, Roman.