Bug In Persona Theme

Another great day! Today i got another e-mail from my friend Micah in US.

He said that he is using a theme from ColorLabs named Persona. At the first look, i’m surprised if a WordPress theme could be something like this one. The front page only displaying your social networking feeds.

Persona - Premium Social Feed WordPress Theme

At Persona home page, you can put so many items, such as your blog posts, Twitter feeds, etc. But, the main problem is: sometimes, Micah cannot see his blog post or Flickr feed.

The case is like this one:

Micah have a Flickr account and display it on his theme which using Persona theme. Some day, he decide to create a new Flickr account to support his job.

Since his new account doesn’t have many photo yet, he decide to turn off Flickr feed on Persona. In several week after that, he already have enough photos at his new account. When he want to display the feed on the Persona theme, his Flickr feed didn’t showed up.

He already try to deactivate the theme and then activate it to see whether it is working or not. But, there is no hope.

After frustrate with Persona theme he bought for $79, he decide to contact me by sending me the copy of Persona theme (is it a piracy? :), thank you Micah for the copy).

After checking the file (index.php), i realize if the content is just a hook. So, i can tell to Micah if the problem is coming from this:

get_header();
    $sortings = get_option('colabs_sorting');

	if(empty($sortings))
	$sortings = array('instagram','blog','twitter','flickr','pinterest');

	foreach ($sortings as $sorting):
		get_template_part('home',$sorting);
	endforeach;
get_footer();

The bug is coming from that code. For detail, i cannot tell you what is real problem, since all codes on Persona theme is clean.

To fix it, i modify the code become:

get_header();
    $sortings = get_option('colabs_sorting');

	if(empty($sortings))
	$sortings = array('instagram','blog','twitter','flickr','pinterest');

	foreach ($sortings as $sorting):
		get_template_part('home',$sorting);
	endforeach;
delete_option('colabs_sorting');
get_footer();

I add delete_option to empty the array. Then, i refresh the front page to check whether it is empty or not.

And, the front page is empty, just like what i hope. The last action i made is to delete the delete_option code i added before, the result is: his Flickr now is displayed.

Not sure what is the problem, but this technique solve the problem (i’m pretty sure if this technique also can be used to fix the missing blog posts, twitter feeds, etc. on Persona home page)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s