Firebug says jQuery is loaded but $() and jQuery() are not defined

jQuery needs to be outside the wrapper like so: <script type=”text/javascript”> (function($) { $(document).ready(function() { alert(‘hello?’); }); })(jQuery); </script> Edit: A better way would be: jQuery(document).ready(function($) { // $() will work as an alias for jQuery() inside of this function }); Also make sure any inline script tags are AFTER your call to wp_head(); And … Read more

Impossible to call wordpress function inside an include?

I’ve had this problem in past try using include with locate_template: I don’t exactly remember the reason but this code still works: Example: include(locate_template(YOUR_TEMPLATE_PATH)); Here’s a complete demonstration too, using the same idea, if you need more help. For Admin Panel include simply works in admin panel. You might want to modify your code like: … Read more

Include comments form in plugin page

Just as @Jevuska mentioned, you can use the $post_id as an argument here, in fact, you can also use a ton of optional $args as well <?php comment_form( $args, $post_id ); ?> You can find the information in the Codex here: https://codex.wordpress.org/Function_Reference/comment_form

Automatically include all php files in a child theme directory

I suspect glob needs the current working directory to work, so you could try passing the full path of the file to the existing function you have… include_all_php(dirname(__FILE__).’/includes’); Or set the current working directory first: setcwd(dirname(__FILE__).”https://wordpress.stackexchange.com/”); include_all_php(‘includes’); Alternatively you could also use scandir: $filepath = dirname(__FILE__).’/includes/’; $files = scandir($filepath); foreach ($files as $file) { // … Read more

Use of Templates in a Plugin

You would need to add a filter to the page_template hook that will look for whatever criteria you need. For example, if your plugin was for a custom post type you would have something like this: function myCustomTemplate( $page_template ) { // Check theme for template file $located = locate_template( ‘single-{{postype}}’ ); if ( ! … Read more

get_option() not returning expected value from plugin

It looks like your serialized settings are corrupted. I created the option mfwp_settings with the value array( ‘test’ => ‘response’ ). When I look at this in the database, the value is stored as a serialized array and looks like this: a:1:{s:4:”test”;s:8:”response”;} Here is a simple debugging function that successfully returns the expected value response … Read more

code is skipping a div

ok after days of doing the same thing over and over….commenting out different combinations of files…I realised the problem was actually an extra closing div which the code editor threw in for me in one of the files!!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)