Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a simple example to illustrate my problem here.

http://www.ttmt.org.uk/forum/wordpress-forum/

It's just one page, home.php.

The home page has a list of images that are made into a slideshow.

From Settings > Reading > Front page display, I have selected the home page as the Front page.

The home page loads but without the slideshow.

If I click 'Home' to reload the home page the slideshow appears.

Why does the slideshow not appear when the page opens.

share|improve this question
    
There's not enough information here for anyone to help out, are you using a plugin, default themes, jquery, etc... please add more information and examples of coding on the page. –  Vince Pettit Aug 2 '12 at 11:08
    
Note related to wordpress - misconfigured JavaScript doing all this stuff. –  amit Aug 2 '12 at 11:24
1  
It is partially related to WordPress, because WordPress uses no-conflict for jQuery, which does impact the OP's issue. –  Chip Bennett Aug 2 '12 at 11:26
add comment

closed as too localized by Michael, Chris_O, kaiser, anu, Wyck Aug 19 '12 at 0:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

The name home.php is reserved for use by the Template Hierarchy as the Blog Posts Index. To create a custom template for the Site Front Page, use front-page.php.

Another issue: your slideshow jQuery script needs to have a no-conflict wrapper, and should not execute until the page is loaded.

Instead of this:

$(function()

...you need to use this:

jQuery(document).ready(function($)

Edit

Aside from those two issues, I'm not sure your problem is WordPress-specific.

I notice that you're including jQuery cycle before you include jQuery itself. I'm not sure if that would cause issues or not.

Edit 2

From your comment:

The Theme contains...front-page.php (static page that is the front page)

I suspect that this is somehow contributing to your problem. The front-page.php file is not a static page but rather a Theme template file. A static page is not an actual file, but merely a database entry - a post with a post-type of page. A Theme template file is a file that WordPress uses to output content based on the current context.

Please review the Codex entry for creating a static front page, and ensure you're following all instructions correctly. Once you've got your static front page configured properly, let's see if the problem persists.

share|improve this answer
    
I followed your suggestions, changed the name of home.php and the jquery - still not working. The slideshow loads but it's just a thin strip, the rest seems to be hidden. If you scroll left/right near the nav you can see the rest of the slideshow –  user668499 Aug 2 '12 at 14:22
    
Another question: I notice that the page name changed from Home to Front Page. What template files are included in your Theme, and what static Page are you using for the front page? –  Chip Bennett Aug 2 '12 at 14:29
    
The theme contains: footer.php, front-page.php (static page that is the front page), functions.php, header.php and index.php. I tried to replicate the situation outside Wordpress, but it works then - ttmt.org.uk/cyclegallery I think the cycle link might come before the jquery because I was following the advise here and getting the jquery in the functions.php - wpmu.org/… –  user668499 Aug 2 '12 at 15:00
    
See updated answer in re: front-page.php and proper configuration of a static front page. Regarding your jQuery enqueueing: please post the relevant functions.php code in your answer. –  Chip Bennett Aug 2 '12 at 15:07
    
The static front page was set up as described in the Codex. I think my terminology might have confused the matter. front-page.php is the template I'm using for the page. This is the code used in the functions.php - <?php function my_init() { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2'); wp_enqueue_script('jquery'); } } add_action('init', 'my_init'); ?> –  user668499 Aug 2 '12 at 15:30
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.