Elegant Themes Giveaway – 3 Developer Accounts Worth $89 Each!

May 15th, 2013 Blog

Header

ElegantThemes is giving away 3 Developer Accounts which are valued at $89 each! With a Developer Account, you get access to all their themes and plugins with updates and support for a full year.

How to Participate

To enter the contest, all you need to do is like our page on Facebook or follow us on Twitter via the widget below. You can also comment or tweet what is your favorite Portfolio WordPress Themes? The contest ends next Wednesday (22/5), and you can re-tweet each day to enter another ticket into the raffle by revisiting this post and using the widget below!

All 3 winners will be selected randomly at the end of the giveaway. Good luck!

a Rafflecopter giveaway

Share This | Read on | 13 Comments


Theme Update: iPin Pro v1.4

March 23rd, 2013 Blog

Changelog for iPin Pro: WordPress Pinterest Clone Script

  • Option to disable lightbox
  • Option to allow html tag in description
  • Option to add price tag
  • Option to add ‘I agree’ checkbox to register form
  • Email friend button
  • Report pin button
  • Zoom button for bigger image
Share This | Read on | 2 Comments


Upload Multiple Photos for iPin Pro Theme

February 19th, 2013 Blog

Multiple Upload Plugin for iPin Pro theme

For every photo uploaded thru WordPress media uploader, the original Automatic Featured Image Posts plugin creates a new post and set the featured image. I’ve modified the plugin so that it will also assign a board to the newly created post for iPin Pro theme. Useful for uploading multiple photos from your computer.

Note that this only work for the admin with user ID 1. And you must deactivate this plugin when done batch uploading. Otherwise there will be double posting when adding pins (only user ID 1, other users are not affected). Tested on WP3.5.1.

Download

Faqs

How can I allow other users to upload multiple photos?
Unfortunately there’s no easy way as this plugin has a site wide effect of double posting for other users. If you need to temporarily allow another user to do multiple uploading, you can modify the plugin. In automatic-featured-image-posts.php, replace the user id in

if (current_user_can('administrator') || $current_user->ID == 1)

and

if ($current_user->ID != 1)

and

$parent_board_id = get_user_meta(1, '_Board Parent ID', true);

amd

echo '- Only works for User ID: 1<br />';

Then you and the other user will need to coordinate with each other

  1. You go to WP-Admin > Users > All Users > Change the Role for the other user to Editor (if other user is not already an editor)
  2. Other user go to WP-Admin > Settings > Auto Image Posts > Select the Default Board
  3. Other user go to WP-Admin > Media > Add New > Upload his photos
  4. When other user is done, ask him not to upload any photo until you deactivate the plugin
  5. You deactivate the plugin and change back his role in step 1 if necessary
Share This | Read on | 2 Comments


Theme Update: iPin Pro v1.2

January 10th, 2013 Blog

Changelog for iPin Pro: WordPress Pinterest Clone Script

  • Facebook & Twitter login
  • Support WP User Roles (Editor, Author, Contributor, Subscriber)
  • Option to enable/disable infinite scroll
  • Antispam mechanism in register form (no captcha required)
Share This | Read on | No Comments


Theme Update: OneNews 3.2

December 11th, 2012 Blog

Changelog

  • new: iframe browser
  • new: offset option in textRSS widget
  • more/less section text fix
  • mediqueries finetuning

OneNews v3.2 should work with WordPress 3.4 and the upcoming v3.5. For existing users, please contact me and I will email you the new package. Please include your Paypal email address for verification purpose.

Share This | Read on | No Comments


OneNews Premium Theme: Auto Generate Daily Archives

November 29th, 2012 Blog

The OneNews Premium Theme already allows you to create multiple pages of feeds. With this hack you can create daily snapshots for each onenews feeds page. In a year you will have 365 pages for each page. Automagically. View live demo at http://ericulous.com/onenews/archives/. The idea is to copy the index.html files generated by WP Supercache and archive them in an “Archives” directory daily.

1. First you need to install and activate the WP Supercache plugin.

2. In themes/onenewspremium/functions.php, add the following just before the last line “?>”

function dailyarchives() {
	global $wpdb;
	$siteurl = trailingslashit(strtolower(str_replace('http://', '', site_url())));
	$filedir = WP_CONTENT_DIR . '/cache/supercache/' . $siteurl;
	
	//remove if don't want to display homepage archives
	//archive homepage
	if (!is_dir(ABSPATH . 'archives/')) {
		mkdir(ABSPATH . 'archives/');
		mkdir(ABSPATH . 'archives/homepage/');
	}

	$oldfile = $filedir . 'index.html';
	if (file_exists($oldfile)) {
		$newfile = ABSPATH . 'archives/homepage/homepage_' . strtolower(date('Y_m_d')) . '.html';
		copy($oldfile, $newfile) or die("Unable to copy $old to $new.");
	}
	//end archive homepage
	
	//archive onenews subpages
	$onenewspages_query = 'SELECT ' . $wpdb->prefix . 'posts.post_name
		FROM ' . $wpdb->prefix . 'posts,' . $wpdb->prefix . 'postmeta
		WHERE ' . $wpdb->prefix . 'posts.post_type = "page"
		AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_page_template"
		AND ' . $wpdb->prefix . 'postmeta.meta_value = "page_onenews.php"
		AND ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.ID
		ORDER BY ' . $wpdb->prefix . 'posts.ID ASC
		';

	$onenewspages = $wpdb->get_results($onenewspages_query);

	if ($onenewspages) {
		foreach ($onenewspages as $onenewspage) {
			$oldfile = $filedir . $onenewspage->post_name . '/index.html';
		
			if (file_exists($oldfile)) {
				if (!is_dir(ABSPATH . 'archives/' . $onenewspage->post_name . '/')) {
					mkdir(ABSPATH . 'archives/' . $onenewspage->post_name . '/');
				}
			
				$newfile = ABSPATH . 'archives/' . $onenewspage->post_name . '/' . $onenewspage->post_name . '_' . strtolower(date('Y_m_d')) . '.html';
				copy($oldfile, $newfile) or die("Unable to copy $old to $new.");
			}
		}
	}
	//end archive onenews subpages
}
add_action('dailyarchives_hook', 'dailyarchives');

if (!wp_next_scheduled('dailyarchives_hook')) {
	wp_schedule_event(time(), 'daily', 'dailyarchives_hook');
}

3. In themes/onenewspremium/ direcotry, create a new file named “page_archives.php” and paste the following code (skip this step if you have OneNews v3.2)

<?php
/*
Template Name: OneNews Archives
*/
?>

<?php get_header(); ?>
<div id="postbody">
	<div id="postwrapper">
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
          	<div class="postcontent">
				<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'onenews' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h2>
				<hr />
				<?php
				if ($_GET['i']) {
					$dir = ABSPATH . 'archives/' . $_GET['i'];
					
					if (is_dir($dir)) {
						$files = scandir($dir, 1);
						
						if($files) {
							foreach ($files as $file) {
								if ($file != '.' && $file != '..') {
									$linktitle = str_replace('.html', '', $file);
									$linktitle = str_replace('_', ' ', $linktitle);
									$linktitle = str_replace('- ','-',ucwords(str_replace('-','- ',$linktitle)));
									echo '<p>&raquo; <a href="' . network_home_url('/') . 'archives/' . esc_attr($_GET['i']) . '/' . $file . '">' . $linktitle . '</a></p>';
								}
							}
						}
					} else {
						_e('No archives found.', 'onenews');
					}
				} else {
					?>
					<!-- remove if don't want to display homepage archives -->
					<p>&raquo; <a href="<?php echo get_permalink() . '?i=homepage'; ?>">Homepage</a></p>
					<!-- display homepage archives -->

					<?php
					$onenewspages_query = 'SELECT ' . $wpdb->prefix . 'posts.post_title, ' . $wpdb->prefix . 'posts.post_name
						FROM ' . $wpdb->prefix . 'posts,' . $wpdb->prefix . 'postmeta
						WHERE ' . $wpdb->prefix . 'posts.post_type = "page"
						AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_page_template"
						AND ' . $wpdb->prefix . 'postmeta.meta_value = "page_onenews.php"
						AND ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.ID
						ORDER BY ' . $wpdb->prefix . 'posts.post_title ASC
						';
				
					$onenewspages = $wpdb->get_results($onenewspages_query);

					if ($onenewspages) {
						foreach ($onenewspages as $onenewspage) {
						?>
						<p>&raquo; <a href="<?php echo get_permalink() . '?i=' . $onenewspage->post_name; ?>"><?php echo esc_attr($onenewspage->post_title); ?></a></p>
						<?php
						}
					}
				}
				?>
			</div>
		</div>
        
        <div class="clearer"></div>
		
		<?php endwhile; endif; ?>
	</div><!-- END POSTWRAPPER -->
    
	<?php get_sidebar(); ?>
	
	<div style="clear:both"></div>
</div> <!-- END POSTBODY -->
<?php get_footer(); ?>

4. Go to WP-Admin > Pages > Add New (Enter “Archives” for Title and select “OneNews Archives” in the Template dropdown menu. If you get a “Forbidden Error” viewing the Archives page, change the slug to “archive” (see pic).

5. Go to WP-Admin > Appearance > Menus (Add the newly created Archives page to your top menu)

Notes: For this hack to work properly, WP Supercache must have the super cached index.html files generated for copying. When your site is new and not many visitors yet, WP Supercache may not have the files ready. Try turning on the Preload Mode to automatically generate the super cached files. May have to wait a day or two for the archives to start showing.

Share This | Read on | 4 Comments


OneNews Premium Theme – Recommended Settings for WP Super Cache

November 19th, 2012 Blog

These settings works well for me. Feel free to tweak and adapt for your own OnewNews site.

Under Advanced Tab

Select the following options:
- Cache hits to this website for quick access.
- Use mod_rewrite to serve cache files.
- Don’t cache pages for known users.
- Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated.
- Extra homepage checks. (Very occasionally stops homepage caching)

Expiry Time & Garbage Collection
- Cache Timeout: 1800
- Scheduler: Timer: 600

Under Preload Tab

- Refresh preloaded cache files every 30 minutes
- Preload all posts
- Select Preload mode (garbage collection only on legacy cache files.)

Extra

WP Super Cache Preload strangely does not “preload” the homepage. Only the single posts and pages are preloaded. So we have to setup cPanel cron to hit our homepage manually. Why 0,1 & 30,31? It seems to take 2 hits for supercache to properly preload and clear garbage.

  1. Login to your webhost cPanel at http://your-domain.com/cpanel
  2. Select the “Cron jobs” icon
  3. For the first job, enter
    • Minute: 0,1,30,31
    • The rest: *
    • Command: wget -q -O – http://your-website.com/wp-cron.php?doing_wp_cron
  4. For the second job, enter
    • Minute: 2,32
    • The rest: *
    • Command: wget -q -O – http://your-website.com/

Note 1: Some webhost disables the wget command. Check with your webhost.
Note 2: WP Super Cache only serves the preloaded supercached pages to unknown users, meaning you need to logout of WordPress to see them.

Share This | Read on | 9 Comments


Sneak Peek: iPin Theme – Pinterest Inspired Design

September 19th, 2012 Blog

iPin - Pinterest Inspired WordPress Theme

This pinterest inspired theme is almost 80% done. Just need to do some code cleanup, put up a theme options panel and gasp… create a 100 posts demo blog to showcase the theme.

The demo link below probably won’t do the theme justice but you can get a quick look and feel. As there’s not enough posts, you can resize your browser to see the responsive masonry and infinite-scroll effect.
iPin WordPress Theme Demo

Update: New iPin WordPress Theme Demo

Share This | Read on | 1 Comment


Themes and Plugins Compatibility on WP 3.4

June 15th, 2012 Blog

Once again, as the new features/changes in 3.4 involves mainly the WordPress Admin backend, I don’t foresee much issue upgrading.

Plugins

All three free plugins (excluding the Feedburner Sitestats plugin) should work fine in WordPress 3.4 without modification.

Themes

All free themes and premium themes should work fine in WordPress 3.4. Remember to backup your theme first before upgrading and report any bugs you found.

Share This | Read on | No Comments


Giveaway Contest Results

May 26th, 2012 Blog

Thank you all for participating. Congratulation to the winners for the Elegant Themes Membership.
I will be sending the winners’ email to Nick and he will in be touch with the winners shortly.
Thanks again to Elegant WordPress Themes for the wonderful prizes!

The Winners

Dimitar Tsonev: favorite theme – AskIt
James: favorite theme – TheStyle

Share This | Read on | 1 Comment


Giveaway Contest: Free ElegantThemes Membership!

May 21st, 2012 Blog

Nick from ElegantThemes is giving away 2 ElegantThemes memberships to Ericulous readers! Get free access to all current 76 Premium WordPress Themes (with more coming).

The Prize

2 x Memberships worth $39/year each

How to Participate

Simply browse through the ElegantThemes Gallery on Ericulous. Then leave a comment to this post about your favorite theme e.g “My favorite theme is the Chameleon.”

2 winners will be selected by random.org on 26 May 2012 and notified via email. Good luck and comment away!

Share This | Read on | 12 Comments


Theme Update: OneNews 3.1

February 23rd, 2012 Blog

Changelog

  • new: responsive design
  • new: show more/less feed items
  • new: show blank thumbnail if no images in feed for photo/videorss.tmpl
  • new: show/hide bookmark/feed/searhbar icon options in admin
  • new: full width page template
  • bugfix: dates not displaying for posts with same dates
  • bugfix: remove comma when no relative date
  • bugfix: display widget titles for international language

For existing users, please contact me and I will email you the new package. Please include your Paypal email address for verification purpose.

Contact me here

Share This | Read on | 3 Comments


Redirect Gallery Image Links in RSS Feed to Parent Post

January 4th, 2012 Blog

rss-gallery

When using the [ gallery ] shortcode, the individual photos are linked to the photo attachment page in the rss feed e.g when your visitors click on the above first photo in Google Reader, they are brought to the thumbnail attachment page (http://ericulous.com/demo/2007/07/19/full-of-images/attachment/01/). Which may be confusing to your visitors if your theme does not have a nicely formatted attachment.php file.

The [ gallery link=file ], which should open the full image directly, also doesn’t work. Not ideal either as I prefer my visitors to view my post rather than simply view all the images from Google Reader. In this case, I would rather they be redirected to the parent post (http://ericulous.com/demo/2007/07/19/full-of-images/).

So I created a new file – attachment.php in my theme directory and insert the following code. If your theme directory already have a attachment.php, you can insert the code in the very first line.

<?php
header( 'location:' . get_permalink( $post->post_parent ) );
?>

Share This | Read on | 1 Comment


Themes and Plugins Compatibility on WP 3.3

December 13th, 2011 Blog

Once again, as the new features/changes in 3.3 involves mainly the WordPress Admin backend, I don’t foresee much issue upgrading.

Plugins

All three free plugins (excluding the Feedburner Sitestats plugin) should work fine in WordPress 3.3 without modification.

Themes

All free themes and most of my premium themes should work fine in WordPress 3.3. Remember to backup your theme first before upgrading and report any bugs you found.

Share This | Read on | No Comments


Themes affected by TimThumb Zero Day Vulnerability

August 5th, 2011 Blog

You probably heard of the TimThumb Zero Day Vulnerability by now and unfortunately (or fortunately) only 2 of my themes (HackerWP and Celebrity Gossip) uses the TimThumb script for generating thumbnails. The fix is pretty easy.

1. Go to your theme cache directory (e.g /wp-content/themes/hackerwp/cache) and delete all files except index.htm
2. Download the latest version of timthumb.php and replace the file on your server at /wp-content/themes/hackerwp/timthumb.php
3. Optional: If you wish to grab image files from all external sites. Open timthumb.php, look for

$allowedSites = array (
'flickr.com',
'picasa.com',
'img.youtube.com',
);

and replace with

$allowedSites = array (
'*',
);

Share This | Read on | 4 Comments


Themes and Plugins Compatibility on WP 3.2

July 5th, 2011 Blog

Since the new features/changes in 3.2 involves mainly the WordPress Admin backend, I don’t foresee much issue upgrading. I’m now running on 3.2.

Plugins

All three plugins (excluding the Feedburner Sitestats plugin) should work fine in WordPress 3.2 without modification.

Themes

All free themes and most of my premium themes should work fine in WordPress 3.2. Remember to backup your theme first before upgrading and report any bugs you found.

Share This | Read on | 1 Comment


Themes and Plugins Compatibility on WP 3.1

February 25th, 2011 Blog

Plugins

All three plugins (excluding the Feedburner Sitestats plugin) should work fine in WordPress 3.1 without modification.

Themes

All free themes and most of my premium themes should work fine in WordPress 3.1. Remember to backup your theme first before upgrading and report any bugs you found.

Share This | Read on | 1 Comment


Theme Update: OneNews 3.0

January 3rd, 2011 Blog

OneNews 3.0 receives a major revamp, in design and functionality. And now requires at least WordPress version 3.0 to work. I have tested it on WordPress 3.1 RC2 so I do not expect any issues when WP3.1 is released.

Main Highlights

  • Dropdown Custom Menu
  • New tooltip with thumbnail, social media, new indicator, relative date
  • Support for Vimeo videos
  • Sideblog revamp
  • Localization ready

For existing users, please contact me and I will email you the new package. Include your Paypal email address for verification purpose.

Contact me here

Share This | Read on | 6 Comments


Activating WordPress Multisite Mode

December 1st, 2010 Blog

I have 3 different installations of WordPress on this domain: one for this blog, one for the demo blog, one for the onenews blog. It can be a pain when it comes to upgrading the WP core and plugins. So I decided to take a jump and activate the multisite mode which was introduced in WP3.0.

Enabling multisite mode turns out to be a relatively easy task with this simple guide. Encountered some hiccups along the way but nothing where a hack won’t do.

The Road Blocks (and getting past them)

Google XML Sitemap plugin not compatible
The stable version 3.2.4 is not compatible with the new multisite feature. This being a must have plugin, I went ahead and installed the 4.0b3 Beta version.

Not given the option of sub-directories, sub-domains installed by default
Turn out that if your site is more than 30 days old, you will not be presented with the sub-directories option. Luckily you can force enable it. Simply follow the How to Force Multi Site to Use Subdirectories guide.

Broken links in main blog
All my posts permalink were modified to point to /blog, so http://ericulous.com/2007/mypost/ becomes http://ericulous.com/blog/2007/mypost/

That would be an SEO disaster! No fear. Go to Super Admin > Sites > Edit > Permalink Structure and remove “/blog”.

Funny characters in posts
As my database tables are of collation latin1, the define(‘DB_CHARSET’, ‘UTF-8′) was commented out in wp-config.php. Once I switch on multisite mode, suddenly WordPress decided that my tables should be in UTF-8. I have to uncomment that line so that the non-english characters display correctly.

Unable to create new blogs
With the main blog settled, I happily went and created a new sublog. And got “Error establishing a database connection” or “One or more database tables are unavailable. The database may need to be repaired.”. I went into phpmyadmin and noticed no tables were created for the new sublog.

I suspect it was something to do with what I did to define(‘DB_CHARSET’, ‘UTF-8′). So I comment out that line again and viola.. new sublog added. After finish adding, I have to uncomment it again! I don’t understand the logic behind that but I’m glad it works. Also I don’t see myself adding sublogs frequently so a small inconvenience here. Just have to remind myself to comment/uncomment define(‘DB_CHARSET’, ‘UTF-8′) in wp-config.php when required.

Theme switcher not working
I have the theme switcher plugin in demo blog but it’s unable to switch themes anymore. Turn out it was being cached by WP-Super-Cache, even though I did not activate the plugin in the sublog. Apparently supercache is enabled across all the sublogs. The simple solution is to add /demo/ to the rejected strings field in supercache.

Share This | Read on | 6 Comments


How to Add a “Show All Comments” to Your Posts

November 2nd, 2010 Blog

Wordpress Show All Comments

Have you been to a blog that have hundreds of comments which are separated into many pages? Now made easy with the Paged Comments feature from WordPress v2.7 onwards. It can be a pain sifting through each page looking for something. Now wouldn’t it be nice if there’s an option to show all comments with a click? Do your visitors a favor by adding a “Show All Comments” feature.

Since codes differ from theme to theme, I will be using my Google Chrome theme as an example. It should be fairly easy to apply to other themes.

Open comments.php and replace

<h3 id="comments">Reader's Comments</h3>

With

<h3 id="comments">Reader's Comments</h3>
<?php if ($_GET['showall'] != '1') { ?>
<a href="?showall=1#comments">Show all comments</a>
<?php } ?>

Replace

<?php wp_list_comments(array('callback' => 'custom_comment', 'type' => 'comment')); ?>

With

<?php if ($_GET['showall'] == '1') { ?>
<?php wp_list_comments(array('callback' => 'custom_comment', 'type' => 'comment', 'per_page' => '0', 'page' => '0')); ?>
<?php } else { ?>
<?php wp_list_comments(array('callback' => 'custom_comment', 'type' => 'comment')); ?>
<?php } ?>

Replace

<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link('Newer Comments &raquo;') ?></div>

With

<?php if ($_GET['showall'] != '1') { ?>
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link('Newer Comments &raquo;') ?></div>
<?php } ?>

Share This | Read on | 1 Comment