Title: function dillema
Last modified: August 20, 2016

---

# function dillema

 *  [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/)
 * Hi, all –
 * I have a dillema that I would like to ask:
 * My about subpages:
 * [About](http://ocklaw.com/new/about/)
 * Only works if I turn off:
 * wp_enqueue_script(‘slideshow_script’); function. (in localhost)
 * It still does not work live. Why ?
 * The dillema is I need that function for the front page or home if I turn it off
   then, the front slideshow will not works. Any body has any solution how to keep
   the slideshow works without meshing up the about subpages (in localhost) ?
 * Anyone has other solution ?

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/function-dillema/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/function-dillema/page/2/?output_format=md)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610244)
 * This doesn’t sound like a multisite specific issue.
 * Is that function from a plugin or a theme?
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610382)
 * It’s a theme. function.php I add the Javascript codes link in the functions.php.
 * you can check the source if you would like:
 * [About – Vision](http://ocklaw.com/new/about/vision/)
 * Last time you said I must turn off the slideshow script. I did and it works only
   in localhost. It doesn’t work online.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610397)
 * I also only able to see the real custom page offline if I login to admin page
   at the same time, otherwise this type of page appears:
 * [About – Vision](http://ocklaw.com/new/about/vision/)
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610400)
 * You need a different theme, man. That one’s messed up all over the place.
 * Turn on the DEFAULT TwentyEleven theme, and turn off ALL plugins on that site.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610423)
 * I have no choice. I have to fix the sub-pages on that themes. I am developing
   it for someone.
 * You mean switching the themes temporarily and slashing out all the plugin from
   functions.php ?
 * Well, here is a similar thread: [custom page](http://wordpress.org/support/topic/custom-page-8?replies=5)
   that might give better prespective on the problem.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610424)
 * Strange, I have tried turning off all the JS link from functions.php . and the
   same page is still appears.
 *     ```
       <link rel="stylesheet" type="text/css" media="screen" href="sidebanner.css" />
       <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
       <script type="text/javascript" src="js/jquery.cycle.all.js"></script>
       <script type="text/javascript">
   
       $(function() {
       	$('#slideshow').before('<div id="nav" class="nav">').cycle({
       	fx:     'fade',
       	speed:  'fast',
       	timeout: 3000,
       	pager:  '#nav',
       	before: function() {
       	if (window.console) console.log(this.src); }
       });
       });
       <HTML>
       ```
   
 * I wonder where all those things come from ? I already turn of all the js from
   functions.php
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610440)
 * Switch to a different theme to TEST if it’s the theme.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610451)
 * Well, I can’t test it in different themes.
 * For example: if I switch to TwentyEleven theme for example. The side navigation
   will disappeared.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610454)
 * You **can** test, you just don’t want to. Different things. The side navigation
   will be saved, buy the way. But if you don’t test, you will never know if it’s
   your theme or a rogue plugin.
 * You know what you need to do. Go do it.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610458)
 * what’s a rogue plugin?
 * Well, the side navigation is a custom side navigation from the theme that I developed.
   Other’s themes do not show the custom navigation if I switch the themes only 
   the content.
 * The side custom navigation directs me to custom sub pages.
 * Probably the theme, and then how to fix the custom themes?
 * [About](http://ocklaw.com/new/about/)
 * I already try to disable the whole JS from functions.php and
 * [About – Vision](http://ocklaw.com/new/about/vision/)
 * Still shows me incorrect page.
 * Last time, you told me because there is some script above the html. I do not 
   know how to erase them.
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610459)
 * Hi,
 * I copy some files like about, about – vision, page.php to twentyten theme and
   it works.
 * The side navigation direct to the about – vision page correctly.
 * That’s correct, the <!DOCTYPE html> suppose to on top and all the link to JS 
   and css underneath it.
 * Why there are some script above <!DOCTYPE html> on my custom theme ?
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610461)
 * A rogue plugin is one that’s doing something stupid.
 * However if your template works in another theme, with all the same plugins installed,
   congratulations! You have a broken theme!
 * Moving this to the theme section.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610466)
 * What is the slideshow script being enqueued, where (and exactly how) are you 
   calling `wp_enqueue_script('slideshow_script');` in functions.php, and how and
   where do you intend this script to be used in the template?
 *  Thread Starter [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * (@davy_yg)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610467)
 * I call wp_enqueue_script(‘slideshow_script’); in :
    function my_scripts_method(){
 * // for front page
    wp_register_script(‘jquery17_script’, get_template_directory_uri().’/
   js/jquery-1.7.1.min.js’, array(‘jquery’), ‘1.0’); wp_register_script(‘Cycle_script’,
   get_template_directory_uri().’/js/jquery.cycle.all.js’, array(‘jquery’), ‘1.0’);
   wp_register_script(‘slideshow_script’, get_template_directory_uri().’/js/slideshow.
   js’, array(‘jquery’), ‘1.0’);
 * wp_enqueue_script(‘jquery17_script’);
    wp_enqueue_script(‘Cycle_script’); wp_enqueue_script(‘
   slideshow_script’);
 * }
    add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’);
 * I intend the script to be used in home or frontpage.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/#post-2610468)
 * This is very likely a problem:
 *     ```
       wp_register_script('jquery17_script', get_template_directory_uri().'/js/jquery-1.7.1.min.js', array('jquery'), '1.0');
       ```
   
 * You’re enqueueing your own version of jQuery, instead of using the WordPress 
   core-bundled version. To compound the issue, you’re making the core-bundled version
   of jQuery a _dependency_, which means that you’re automatically enqueueing both
   libraries.
 * That becomes further problematic, here:
 *     ```
       wp_register_script('Cycle_script', get_template_directory_uri().'/js/jquery.cycle.all.js', array('jquery'), '1.0');
       wp_register_script('slideshow_script', get_template_directory_uri().'/js/slideshow.js', array('jquery'), '1.0');
       ```
   
 * You enqueue your own jQuery version, and then make the core-bundled version the
   dependency for your other scripts.
 * So, I would recommend that you change your entire function like so:
 *     ```
       function my_scripts_method(){
           // for front page
           wp_enqueue_script( 'jquery17' );
           wp_enqueue_script( 'Cycle_script', get_template_directory_uri().'/js/jquery.cycle.all.js', array('jquery'), '1.0' );
           wp_enqueue_script( 'slideshow_script', get_template_directory_uri().'/js/slideshow.js', array('jquery'), '1.0' );
       }
       add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
       ```
   
 * (No need to split the register and enqueue, since you’re doing both at the same
   time anyway.)
 * That _might_ fix your entire slideshow problem. If not, there will be something
   else we need to track down.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/function-dillema/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/function-dillema/page/2/?output_format=md)

The topic ‘function dillema’ is closed to new replies.

 * 17 replies
 * 3 participants
 * Last reply from: [davy_yg](https://wordpress.org/support/users/davy_yg/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/function-dillema/page/2/#post-2610493)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
