Daily Archives: 09/12/2011

Page 1 of 11

[ARTISTEER BUG] Plugins Not Working on Main/Home Page

If you are an avid Artisteer user like me to create frameworks for WP (and other CMS engines like Joomla, Drupal, etc.) and are now using the latest stable version (3.1.0.42580), you will notice a bug on your generated theme once you upload and activate it in your WordPress blog. That major bug has something to do with your plugins that involves posting and appearing on your main/home/front page of your site. In fact I’ve noticed this with my latest themes (including this ADRIMARIE.us one), for instance, the footnotes plugin that I’m currently using1.

The Artisteer Forums is quite a good source of finding solutions to your problems, however there are some that aren’t available that you’re going to need to post your problem and have the experts2 take a look at your problem. With the whole footnotes plugin problem that I’ve been having with this site (as well as the Bunnda Channel site), I decided to find a solution in which I could fix it manually.

I did find a few solutions, however these only apply to users who don’t use the excerpts feature in WP. By default Artisteer generates WordPress files with excerpts being values rather than the entire content. I’m pretty sure there are more tight solutions that would benefit both users who use the excerpts feature and users who don’t, but for now, these are for the non-excerpts WP users.

Open your content.php file from your theme folder. Look for the following line:

34
'content' => theme_get_excerpt(),

Replace that line with the following:

34
'content' => theme_get_content(),

This method may break the format for those who are using the excerpts feature of their WP blogs, however this is one of the few fixes to make the plugins work on the main/home page of your site. This particular fix worked for my footnotes problem, but that’s because I don’t use the excerpts feature (I’m not an excerpts person anyway).

The following below fixes an issue with photo gallery plugins3, and although this is somewhat of a different issue from the code fix above, I thought I may put this along with the one above.

Open your functions.php and look for the following snippet:

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
if (!function_exists('theme_get_excerpt')){
	function theme_get_excerpt($args = array()) {
		global $post;
		$more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">?</span>', THEME_NS));
		$auto = theme_get_array_value($args, 'auto', theme_get_option('theme_metadata_excerpt_auto'));
		$all_words = theme_get_array_value($args, 'all_words', theme_get_option('theme_metadata_excerpt_words'));
		$min_remainder = theme_get_array_value($args, 'min_remainder', theme_get_option('theme_metadata_excerpt_min_remainder'));
		$allowed_tags = theme_get_array_value($args, 'allowed_tags',
			(theme_get_option('theme_metadata_excerpt_use_tag_filter')
				? explode(',',str_replace(' ', '', theme_get_option('theme_metadata_excerpt_allowed_tags')))
				: null));
		$perma_link = get_permalink($post-&gt;ID);
		$more_token = '%%theme_more%%';
		$show_more_tag = false;
		$tag_disbalance = false;
		if (function_exists('post_password_required') &amp;&amp; post_password_required($post)){
			return get_the_excerpt();
		}
		if ($auto &amp;&amp; has_excerpt($post-&gt;ID)) {
			$excerpt = get_the_excerpt();
			$show_more_tag = mb_strlen($post-&gt;post_content) &gt; 0;
		} else {
			$excerpt = get_the_content($more_token);
			global $multipage;
			if ($multipage &amp;&amp; mb_strpos($excerpt, $more_token) === false){
				$show_more_tag = true;
			}
			if(theme_is_empty_html($excerpt)) return $excerpt;
			if ($allowed_tags !== null) {
				$allowed_tags = ''tag', 'content'=&gt;$part);
					} else {
						$all_chunks = preg_split('/([\s])/u', $part, -1, PREG_SPLIT_DELIM_CAPTURE);
						foreach($all_chunks as $chunk) {
							if('' != trim($chunk)) {
								$content[] = array('type'=&gt;'word', 'content'=&gt;$chunk);
								$word_count += 1;
							} elseif($chunk != '') {
								$content[] = array('type'=&gt;'space', 'content'=&gt;$chunk);
							}
						}
					}
				}

Within that snippet, look for this line:

266
$excerpt = strip_shortcodes($excerpt);

Simply “comment out” (add 2 forward slashes and a space) in front of that line, like so:

266
// $excerpt = strip_shortcodes($excerpt);

Add this line all the way at the bottom of the functions.php markup:

add_filter( 'the_excerpt', 'do_shortcode');

I’ve tried both of these solutions for the themes and these fixed my footnotes problem. I don’t think I’ll ever put a gallery on this blog, but on the Bunnda Channel blog, it’s highly likely that I may post a gallery in a blog post. Again, these are not the clear solutions, but until we finally get a bug fix with the Artisteer program we’ll have to do all these manual fixes on our new themes with the latest stable versions we have available for now4.

  1. WP-Footnotes []
  2. who are not just Artisteer users but are also gurus with PHP, (X)HTML/CSS, Javascript, etc. gurus []
  3. I think…? Not sure if this can also help with the previous code fix I posted before this… []
  4. SOURCE: Artisteer Forumshere and here. []
Page 1 of 11