Jump to content


trying to integrate wordpress into my site and need a little help


2 replies to this topic

#1 zetsumei

    Young Padawan

  • Publishing Betazoids
  • Pip
  • 269 posts
  • Gender:Male
  • Location:127.0.0.1

Posted 22 January 2007 - 07:33 PM

I'm trying to integrate wordpress (posting feature only) into my site and I'm stuck. I included a news.php file which is in my wordpress themes directory and when I include it in my index.php file I get the following error

Fatal error: Call to undefined function: have_posts() in /home/vxlabs/public_html/staff/wp-content/themes/default/news.php on line 1

I'm wondering If anyone knows the file that contains that function as I do not know. I've looked through all the files and can't find it.

heres the php code for news.php

<?php if (have_posts()) : ?>		
		<?php while (have_posts()) : the_post(); ?>
				
			<div class="chead" id="post-<?php the_ID(); ?>">
				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
				
				<div class="cbody">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>
		
				<p>Filed under <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
			</div>
	
		<?php endwhile; ?>
	<?php else : ?>
	<div class="chead">
		<h2>Not Found</h2>
	</div>
	<div class="cbody">
		<p>Sorry, but you are looking for something that isn't here.</p>
	</div>
	<div class="cfoot">&nbsp;</div>

<?php endif; ?>

Edited by zetsumei, 22 January 2007 - 07:35 PM.


#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 22 January 2007 - 07:42 PM

I'm not familiar with Wordpress, but be sure you checked the install files, configuration files, include files, anything like that. Also, it seems like this 'news.php' is to be included by your index page or something, which is probably where the functions should be included. Make sure you read the manual for setting up correctly and all of that.

#3 zetsumei

    Young Padawan

  • Publishing Betazoids
  • Pip
  • 269 posts
  • Gender:Male
  • Location:127.0.0.1

Posted 22 January 2007 - 07:49 PM

I posted this on the wordpress support forum, maybe I'll get some answers there. I also checked all my config/install files, just to many and I don't know which one goes to what =).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users