Thread Rating:
  • 101 Votes - 2.82 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing on non-standard template
03-04-2010, 07:59 AM
Post: #1
Exclamation Installing on non-standard template
I am using a template that has obviously moved much of the functionality out of the index.php (there is no home.php) and into other files.

Specifically, on deactivation/reactivation of step 2 of the install process (after having chmod'd the index.php to 666 in step 1), I am receiving the following error:
Quote:Template file (/home/wp-content/themes/42k/index.php) does not contain 'have_posts()'.

So, obviously the auto-install process won't work for my setup. So I am looking for the best place to put the code so that it will appear on my "welcome" page which is set within the "Settings > Reading" as my "frontpage":
PHP Code:
<?php
//Code automatically inserted by Featurific for Wordpress plugin
if(is_home())                             //If we're generating the home page (remove this line to make Featurific appear on all pages)...
 
if(function_exists('insert_featurific')) //If the Featurific plugin is activated...
  
insert_featurific();                    //Insert the HTML code to embed Featurific
?>

My index.php contains very little code:
PHP Code:
<?php global $options; foreach ($options as $value) {
if (
get_settings$value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings$value['id'] ); }
}
include (
TEMPLATEPATH.'/bricks/homepage/'.$bxx_index_file);?>

The file referenced by the variable $bxx_index_file contains the following:
PHP Code:
<?php get_header(); ?>

<div id="main">
<?php $post $posts[0]; ?>
<?php 
if (have_posts()) : ?>
<?php 
while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<h3 class="post-title"> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a></h3>  
<div class="metabox">Posted by <?php the_author_posts_link () ?> | Filed under <?php the_category(', '?> | <?php the_time('M j, Y'?> | <?php the_tags('Tags: '', '' | '); ?><?php comments_popup_link(' No Comments'' 1 Comment'' % Comments'); ?></div>
<?php $my_name "$bxx_main_post_type";
if ( 
$bxx_main_post_type == "content" ) {
echo     
the_content(); wp_link_pages('<p><strong>Pages:</strong>''</p>''number');
} else {
  echo  
the_excerpt();
}
?>
</div>            
<?php if ( $count == ) : ?>
<div class="advert-x">
<?php  include (TEMPLATEPATH '/scripts/advert-one.php'); ?>
</div>
<?php endif // ( $count == 1 ) ?>
<?php $count
++ ?>
<?php 
endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('&laquo; Older Entries'?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;'?></div>
</div>
<?php else : ?>
<?php 
endif; ?>
 </div>
<?php get_sidebar(); ?>
<?php get_footer
(); ?>

I tried placing the code before the line
PHP Code:
<?php if (have_posts()) : ?>
but to no avail.

I would reference the site url, but I have the maintenance mode plug-in active and you wouldn't be able to see it anyway.

I suppose I should also ask if this plug-in works not only with posts, but also pages, as this site is developed using pages exclusively (thus far at least).

Thanks, in advance, for any help you can provide!


-Travis Reems
travis_reems@yahoo.com
03-09-2010, 03:51 AM
Post: #2
RE: Installing on non-standard template
Hi Travis,

Thanks for your extensive post! First, to answer your question about Pages and Featurific:

http://featurific.com/support/thread-15....ight=pages

As you can see from the link above, Pages aren't directly supported. However, you can create dummy Posts that reference the desired pages that should work fine. (And then use something like Advanced Category Excluder to prevent these posts from appearing on the home page). Does this approach make sense?

As for Featurific not showing up, try placing the code into the same location you already tried (before the 'have_posts()' line). However, in the Featurific code that you insert, comment out the is_home() line. In other words, replace this line:

if(is_home()) //If we're generating the home page (remove this line to make Featurific appear on all pages)...

with this line:

//if(is_home()) //If we're generating the home page (remove this line to make Featurific appear on all pages)...

This should cause Featurific to appear. Please let me know if this solves the problem for you!

Have a great day!
-Rich
Find all posts by this user


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  template <br> without the black border? Guest 4 11,161 02-25-2011 05:43 AM
Last Post: rinogo
  Will the Featurific Plugin Work On Custom Template Pages bribiz 1 2,231 05-29-2010 07:02 AM
Last Post: rinogo
  It is messing the template at IE Guest 3 1,633 01-22-2010 03:50 AM
Last Post: rinogo
  Installing in Sidebar andreao 1 1,639 03-18-2009 03:18 AM
Last Post: rinogo
  Help Installing on Sidebar alanthonyc 1 3,167 02-19-2009 04:02 AM
Last Post: rinogo
  Problems in installing featurific falguni 1 2,717 02-11-2009 05:19 AM
Last Post: rinogo

Forum Jump:


User(s) browsing this thread: 1 Guest(s)