dimanche 28 février 2016

Why the oputput of an image gallery plugin is not displayed into a page of my WordPress custom theme?

I am pretty new as WordPress developer and I am going crazy with a theme developed by myself starting from 0.

So, at this link you can download the entire theme so you can see in the details the entire code: http://ift.tt/1RwZCDl

On this website I have tryed to install an image gallery plugin named GMedia Gallery (I have tryed also with other plugin and I have similar problem), this one: http://ift.tt/1UrVkji

With this plugin I create a gallery and then going into the:

Appereance --> Menu --> GMedia Gallery ---> My Gallery I add the created gallery as a page into my main menu.

And here I have a big problem because, using my custom theme, clicking on the related link into the main menu, the gallery is not shown and the page appera empty, as you can see here:

http://ift.tt/1RwZCDn

I am pretty sure that this is an issue related to my theme because switching to any of the default WordPress theme (for example Twenty Twelve) the gallery is perfrectly shown into the page, here a screenshot that proves this asserion:

enter image description here

So the problem have to be related to my custom theme because using another theme it works fine !!!

I really have no idea about the reason of this problem. I thinked that maybe coul depend by the fact that I have customized the content-page.php file or that it could be related by some JQuery issue.

In the specific case, as you can see opening the theme project, I have added JQuery into the /assets/js/ directory and then I have add the JQuery support to the theme into the function.php file, in this way:

/* Function automatically executed by the hook 'load_java_scripts':
 * 1) Load all my JavaScripts
 */
function load_java_scripts() {

    // Load JQuery:
    wp_enqueue_script('jquery');
    // Load FlexSlider JavaScript
    wp_enqueue_script('flexSlider-js', get_template_directory_uri() . '/assets/plugins/flexslider/jquery.flexslider.js', array('jquery'), 'v2.1', true);
    // Load bootstrap.min.js:
    wp_enqueue_script('bootstrap.min-js', get_template_directory_uri() . '/assets/bootstrap/js/bootstrap.min.js', array('jquery'), 'v3.0.3', true);

    // Load FancyBox:
    wp_enqueue_script('fancy-js', get_template_directory_uri() . '/assets/plugins/fancybox/jquery.fancybox.pack.js', array('jquery'), 'v2.1.5', true);
    // Load scripts.js:
    wp_enqueue_script('myScripts-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '1.0', true);
    // Load Modernizer:
    wp_enqueue_script('myodernizer-js', get_template_directory_uri() . '/assets/js/modernizr.custom.js', array('jquery'), '2.6.2', true);

}

add_action('wp_enqueue_scripts', 'load_java_scripts');

But I am not so sure that it is correct because when I do:

// Load JQuery:
wp_enqueue_script('jquery');

I am not specifying the path of the jquery.js file, so what is exactly doing? (I have do it many times ago).

So what could be the problem? How can I try to fix it?

Tnx so much



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire