Tag Info

Hot answers tagged

5

Here's a version that uses wp_localize_script(), as suggested by others. It's just a little bit cleaner, since you don't mix your PHP with your JS, and generally a neat way to pass things from the server side to your JavaScript. First, put the following code either in your plugin or your functions.php (I use a plugin so I named it accordingly, but you can ...


4

Check header.php and footer.php; sounds like that link is part of your theme and is pulling that script, possibly from a plugin that is supposed to be included with the theme or in the "must use" plugin folder, which is called mu-plugins in wp-content.


3

To be clear, the Rich Snippets tool is purely for testing what the formatting/markup of your content is already. It does nothing on its own. Most of the markup that the tool is looking for is usually baked into a theme. WordPress helps this along a little bit by incorporating parts of the hAtom format into the body_class(), post_class(), and [possibly] ...


3

Filter 'script_loader_src', you get the source URL as first argument. Then run remove_query_arg() on this URL and return the shortened version. Sample code: add_filter( 'script_loader_src', 'remove_script_version_parameter' ); function remove_script_version_parameter( $src ) { return remove_query_arg( 'ver', $src ); }


3

I would suggest a shortcode: function gcse_wpse_143459($atts,$content) { return '<gcse:searchbox-only></gcse:searchbox-only>'; } add_shortcode('gcse','gcse_wpse_143459'); Then use [gcse] instead of trying to paste in an oddball html-ish tag.


2

I looked at the source code of the site and found this: <meta name="robots" content="noodp,noydir,noarchive,nosnippet"/> Apparently noarchive tells Google to not cache the page. Check out Google Webmaster Tools documentation/guidelines for "Meta tags" for more info on what each value does. PS: If you are unaware, nosnippet should also be removed as ...


2

Probably Wordpress Ad-Manager plugin will help you. Pay attention that the plugin is not free, but it provides information that you need and makes even more.


2

Scripts don't get printed at the wp_enqueue_scripts hook, but rather at the wp_print_scripts hook. That said: don't echo/print scripts, period. Instead, enqueue them properly. Caveat: This method is Plugin territory, and should not be included as Theme code in a publicly distributed Theme. You deregister jQuery, but the step you're missing is registering ...


2

The reason is you are using HostGator and enable the feature is Google Analytics Integration, by enable this one, HostGator will automatically add this snipped of code into your main website and all of it sub or add-on domain: <script src='/google_analytics_auto.js'></script></head> I my self also faced with this issue, my main website ...


2

The basic problem for a script solution is: rel_canonical does not offer any useful filter. So we have to replace that function: remove_action( 'wp_head', 'rel_canonical' ); add_action( 'wp_head', 't5_canonical_subpages' ); The next problem: $GLOBALS['numpages'] is empty before setup_postdata(). We could call that function already here, but it might have ...


2

A friend of mine (John Eckman) wrote WPGPlus which sets out with the goal to do just that. I know some people have had success with it, others not so much. However, it may be a good place to look at the code and use it as a starting point. Good luck!


1

Google does not currently have a public API to allow posting to G+ from anywhere other than their web interface. The scripts that currently do so are using the "mobile" interface to do so, and as such are fragile at best. Additionally, they don't work with 2-step verification (which you should enable on your Google account for security reasons). Therefore ...


1

Hook into the action wp_head, test if you are on the category archive or a single post with that category, and print the proper meta element: add_action( 'wp_head', 'wpse_91073_noindex' ); function wpse_91073_noindex() { if ( ( is_singular() && in_category( 'CATEGORY_SLUG' ) ) or is_category( 'CATEGORY_SLUG' ) ) { print ...


1

Look at this one: http://wordpress.org/extend/plugins/google-adsense-dashboard-for-wp/ Works perfectly.


1

One way to do this is to use the status_header filter. Adding the following to the functions.php file or your theme (or an appropriate plugin file) would do the trick: add_filter( 'status_header', 'your_status_header_function', 10, 2 ); /** * Substitutes a 202 Accepted header for 404s. * * @param string $status_header The complete status header string ...


1

You are missing the 'echo' userfullName = <?php $current_user->display_name;?> should be var userfullName = "<?php echo $current_user->display_name;?>" AND notice that I put quotes around that too. BUT!!!! You should really look at using wp_localize_script for declaring javascript variables. Example: ...


1

You can change it at settings -> general, update Site address and wordpress address. With my site wordpress automatically redirects the domain to www.


1

I use this function to register and enqueue the various scripts my theme uses: function cosmos_enqueue_scripts() { // Load jquery from Google CDN (protocol relative) with local fallback when not available if ( false === ( $url = get_transient('jquery_url') ) ) { // Check if Google CDN is working $url = ( is_ssl() ? 'https:' : 'http:' ) . ...


1

Depends on what exactly you're looking for & how customized output. However, here are some plugins to get started. Hope this helps http://wordpress.org/extend/plugins/gd-star-rating/ (This one is more widely used. Good for review-type site/blog) Or, more can be found here http://wordpress.org/extend/plugins/tags/rich-snippets Update back with the ones ...


1

This is a good question, a year back or so, even I was facing similar problems with a website at work. We wanted to track not only campaign and ads on conversions, but also which keywords are leading to higher conversions. Here's what we finally did. Changed the Destination URL in all the ads to include the {keyword} parameter On the landing pages of my ...


1

Google App Engine is a third party host and dealing with them is really off topic here. That error is a simple permission and/or file error and has nothing to do with WordPress itself. You're beter off asking at Google http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/ or trying https://wordpress.org/plugins/google-app-engine/


1

No, that's not possible. You can find a list of providers for embeddable coontent in wp-includes/class-oembed.php: '#https?://(www\.)?youtube.com/watch.*#i' 'http://youtu.be/*' 'http://blip.tv/*' '#https?://(www\.)?vimeo\.com/.*#i' ...



Only top voted, non community-wiki answers of a minimum length are eligible