PDA

View Full Version : Ajaxtabs & Wordpress



trigatch4
02-14-2008, 04:22 PM
Script: Ajaxtabs
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

I'm using Ajaxtabs within wordpress. I am am pointing to external PHP documents that make calls the wordpress loop to display 1 post from a specific category. Unfortunately, I get a PHP error in that tab:


Fatal error: Call to undefined function query_posts() in /myroot/domain/blah/ajaxtabs/feature-outdoors.php on line 3

Here are the first 3 lines of that script:


<?php
// this is where the Lead Story module begins
query_posts('showposts=1&cat=5'); ?>

Any help is appreciated... will provide specific URL via PM if it would help...

ddadmin
02-14-2008, 08:50 PM
Hmm that's not enough information unfortunately to go by. But in general, if you're getting a PHP error versus a JavaScript one, it has nothing to do with the script itself, but rather, some syntax error in your Wordpress template itself as far as how you're outputting the code for the script. It's a server side error.

trigatch4
02-15-2008, 06:04 PM
The thing is... what I have displayed in the #default section is the SAME EXACT thing I have in the external php. The #default tab displays fine... the other tab does not.

I'd rather not disclose my URL but my AIM is trigatch4 if anyone is willing to give a quick look.

Thank you
Rob

ddadmin
02-16-2008, 09:30 AM
I've never worked with Wordpress' templating system, but the bottom line is, any client side script (ie: Ajax Tabs Script) will work as long the server outputs it as if you were manually including the script on your page in terms of the code embedded when you "view source". If there is a PHP error getting to that point, then the issue isn't related to the script itself, but Wordpress' template system. Perhaps it has a list of reserved words you're stepping on, or convention you're not following etc. But again, this is a server side issue.