0
votes
0answers
18 views

Iris color picker

i try to implement Iris color picker in my wordpress theme and it works fine, but when i include the Iris color picker's files i can't call a custom function via a tag. this is the Iris color picker ...
0
votes
0answers
163 views

Flexslider not working for my custom theme WordPress

I add flexslider to my theme homepage http://templategraphy.com/wp-demo/bluto/ but it didn'not show on my homepage Here is the order of js i placed in function.php function theme_name_scripts() { ...
6
votes
1answer
162 views

Any alternate TinyMCE4 themes / subthemes?

TinyMCE4 in WordPress 3.9 has some cool changes, but it seems to have only one "theme" included. Is there any way to make a sub-theme of the theme defined by CSS, and theme.js in ...
0
votes
2answers
128 views

How to register and enqueue JavaScript files without breaking plugin dependencies?

In theme development, what is the best way to register and enqueue JavaScript files to avoid problems with plugins? I want to create a theme which uses scripts like jQuery, Masonry and so on. I ...
0
votes
2answers
43 views

add jquery file if a certain page is included

I was wondering if anyone could help my by explaining if it is possible to enqueue a javascript file only if for example homepage.php is included. what i have tried to do inside homepage.php: class ...
0
votes
1answer
1k views

Why a SlideShow (made using JQuery FlexSlider) can't work if I load it form functions.php but work if I load it from my footer.php file? [closed]

I have the following situation: I am carrying this pure HTML theme (that use BootStrap CSS framework) into a WordPress theme. This is the original pure HTML demo theme (I have the entire source code ...
0
votes
1answer
102 views

How to correctly add JQuery in a WP theme?

I am pretty new in WordPress and I have the following doubt: I have to include JQuery into a theme and I am doing in this way: I create the following function into functions.php theme file and I add ...
-1
votes
1answer
107 views

Javascript as Jquery Function Call?

Refer to Nice scroll to wordpress wordpress runs jquery in noconflicts mode which means that you either need to write your JS code using the jQuery function call var seq = 0; ...
0
votes
2answers
104 views

Check javascript file Proper way in functions.php

I am trying to convert html to wordpress. The code in the html was: <script src="js/jquery.nicescroll.min.js"></script> <script src="js/jquery.js"></script> ( jQuery v1.7.2 ) ...
0
votes
0answers
93 views

Masonry and infinite scroll child theme

I have a question about masonry and infinite scroll plugin by Jetpack. I've added in my function.php file this code: function mason_script() { wp_enqueue_script( 'jquery-masonry' );} add_action( ...
0
votes
0answers
185 views

Infinite scroll not working with Masonry

I've got masonry working, like so: $('.content').imagesLoaded( function() { $('.wrapper, .content').fadeIn(600); $('.index-page .content').masonry({ itemSelector: '.post', ...
0
votes
2answers
894 views

How to Add a .js file Only in one specific Page Dynamically to Head

I need to add some scrips for Google Maps only in my contact page and I do not want to populate it on all pages. I am not willing to create a custom header as well so I was thinking is there any way ...
0
votes
1answer
94 views

Theme customizer live preview JS- Trying to bind to an html image url without luck

I am having a little trouble binding the theme customizer live preview javascript to an HTML <img src>- more specifically it is my logo. Here how the html looks on the page(which is fine and ...
0
votes
2answers
924 views

wp_enqueue_script not working?

Excuse me, I'm very new to PHP and WordPress, but I'm trying to link to an exterenal js file called trans.js, that relies on jQuery. Here is the code at the beginning of the header.php: <script ...
0
votes
1answer
35 views

Can't attach Javascript to theme

I'm currently learning theme development, and tweaking the twentytwelve theme. I've got an external javascript file I'm trying to link, but it won't seem to register. The codex tells me: <script ...
2
votes
1answer
271 views

Trigger Customizer saving process with Javascript only

I'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing ...
0
votes
1answer
129 views

Set start page depending on screen width [closed]

I'm building a responsive theme and would like to have different start pages depending on screen width. In this case, the start page is set in WP admin and contains an image map built on a cunstom ...
1
vote
0answers
354 views

Single page site with history.js

I'm developing a single page site that shows each page on the front page, like so: *-----------------* | Home | ...
10
votes
2answers
1k views

Does the functions.php file ever get called during an AJAX call? Debug AJAX

Trying to figure out an issue a fellow programmer is having. I was wondering if the functions.php file get called at all when you do admin side AJAX? I know that when you do an AJAX call a part of ...
0
votes
3answers
623 views

Theme Customizer not loading JS for live preview

I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the ...
0
votes
1answer
542 views

wp_deregister_script was called incorrectly

So apparently I am now allowed to do the following in the admin, ON my theme options page and only ON my theme options pages: public function load_admin_jquery(){ ...
1
vote
3answers
2k views

theme path in javascript file

I need to include the path to my theme file within a javascript file. How would I go about this? I have already tried: var templateUrl = "<?php get_stylesheet_directory_uri(); ?>"; function ...
0
votes
2answers
45 views

Including Javascript options

For a Wordpress Theme I know javascript files (ending in .js) must be included using wp_enqueue_script in functions.php but how do I include additional javascript code, for example say I need to add ...
0
votes
1answer
140 views

Paginated WP_Query doesn't return 404's, even when posts don't exist

I'm currently building a theme for a client, and one of their requirements is endless scrolling on a "Charts" page. They want this to be paginated, and the endless scroll to load the next page below ...
0
votes
2answers
240 views

My jQuery is enqueued properly. So why isn't it working?

I'm just trying to add a simple bit of Show/Hide jQuery to a child theme. $(document).ready(function(){ $("#openbtn").click(function(){ $("#openingtimes").toggle(300); }); }); I've saved the ...
0
votes
1answer
692 views

Ajax URLs without #!, how to prevent falling into single.php on load or reload?

I'm trying to make things properly with a single page ajax powered portfolio. I've read that there is no need of #! to make it crawlable by google. So I have clean URLs that updates with .pushState ...
3
votes
1answer
96 views

What is the best practice for customizing a plugin's JavaScript/jQuery?

Most well written plugins support a safe means for a developer to customize/theme the plugin by copying PHP files to the theme directory and modifying the copies rather than the original plugin file. ...
0
votes
2answers
117 views

Using wp_enqueue_script with social media buttons?

I want to embed a social sharing button in the theme. Following is the standard code to embed the twitter button. <a href="https://twitter.com/share" ...
3
votes
4answers
120 views

How do I make my wordpress page more friendly for mobile viewers?

My basic question is How do I make my wordpress page more friendly for mobile viewers? I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ...
0
votes
1answer
99 views

How to convert that page to a wordpress template? [closed]

Couple of days I am trying to integrate THAT page in wordpress. I converted it to wordpress theme but can't make the images to loads. All I see is the loading circle. I changed the path in javascript ...
1
vote
2answers
892 views

Is there a way to set the order of wp_footer hooked functions?

I was wondering if we can set the order of a function hooked to wp_footer(), I created a function that echos: <script> ajsfunction(); </script> and I also enqueued the js file of this ...
9
votes
5answers
6k views

Including jQuery and JavaScript files the correct way

I'm having some trouble with this. I'm not sure how to do it the correct way, and I read so many different techniques and ways to do it that I don't know what to make of it. Some questions and ...
0
votes
1answer
85 views

wp_enqueue_script causes page to vanish

The goal- include my-script.js (dependant on jquery) in my WP theme. The problem- When I use this code,(in the head element of the header template file) my entire page goes blank when loaded: ...
10
votes
4answers
4k views

Solutions for generating dynamic javascript / CSS

Let's say you need to generate javascript or CSS code that depends on the current context. For example you have a form on the homepage that fires an ajax request on submit, and a different form on ...
1
vote
0answers
232 views

Suggestions for Developing a Flipbook Style Theme? [closed]

I'm currently working on a custom WordPress theme that will be a showcase of several different stories, "books" if you will, that contain individual chapters. I'd like to present each of the stories ...
0
votes
2answers
550 views

How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?

I am looking for a solution to reuse the header and footer navigation links (with style, of course) in one of my WordPress website for several other WordPress sites. Please note that I'm trying to ...
3
votes
2answers
621 views

jQuery in header or footer

From my reading it seems there is a good case for loading scripts like jquery and dependencies into the footer as a preference if possible; however 2 things confuse me which. Firstly the default for ...
0
votes
1answer
211 views

security concerns if using html data-* attribute for l10n?

I need to pass a localized multidimensional javascript object to a page. The object is constructed using php and represents some wp-theme settings. I cant find a way to utilize wp_localize_script for ...
10
votes
2answers
1k views

pass object/JSON to wp_localize_script

I've got a working piece of javascript that contains an object literal. But I need to localize it, and I'm ytrying to figure out how to rewrite it so that I can get wp_localize_script() to accet it, ...
0
votes
2answers
194 views

JavaScript Files Registered in Parent Theme Won't Load When Calling wp_enqueue_script() in Child Theme?

I'm making a framework parent theme and in the parent functions.php, I want to register all the possible js files I use frequently and if I want it to load it, in the child functions.php I just have ...
40
votes
2answers
16k views

What is the preferred way to add custom javascript files to the site?

I've already added my scripts, but I wanted to know the preferred way. I just put a <script> tag directly in the header.php of my template. Is there a preferred method of inserting external or ...