Shortcode with multiple variables

If you were to enable debugging and test the code (not sure why you are reluctant to do that), you would see that there are problems with the code. Your array elements need to be separated by commas and PHP variables begin with $. What you have won’t work as is. That kind of pure … Read more

Using Output from one Function and calling it into another

This isn’t really a WordPress question… that said $recClasses = pa_insertPage($output); is incorrect. here you should be passing to insertPage whatever the arguments are. Then insertPage will return $output, making $recClasses the same value as $output. $recClasses = pa_insertPage(‘your attributes’); // $recClasses now equals $output;

Variables posting twice

The parse_query action gets called on every query (menu items, sidebar recent posts widgets, etc.), but get_query_var pulls from the main query, so that condition will be true for all queries despite the fact that the query var doesn’t exist in those queries. You need to check the query object passed to your function hooked … Read more

Difference in Get Variable Location

There is no “normal” way (either is commonplace), but it all comes down to your permalink structure, and whether that has a trailing slash or not. As for your login page, it all depends on how you’re generating the URLs, but I would suggest using user_trailingslashit( $basepath_without_query ). As the name suggests, it will apply … Read more

wp_localize_script not create variable in head section

Your code looks correct. alert(wp_ajax.nonce); should display the nonce. You can also verify the existence of the wp_ajax object via console.log(wp_ajax) in your browser’s Javascript console. wp_localize_script adds the object(s) to the footer (a call to wp_footer() should be present in the theme’s footer.php file). It’ll look like so: <script type=”text/javascript”> /* <![CDATA[ */ var … Read more

Incorrect Blog Root

The old versions of the home and site url are likely in the database somewhere. Add two lines to your config.php file to override them as needed: define(‘WP_HOME’, ‘http://example.com’); define(‘WP_SITEURL’, ‘http://example.com’); If you visit Settings / General and save the settings, they should get stored to their new value in the database. You should then … Read more

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