Tag Info

New answers tagged


Like the previous answer, you can store the GCLID in a session. Google has a tutorial here, just go to the "enable your website and lead tracking system" section for the code - https://support.google.com/adwords/answer/2998031?hl=en


If you want to add a class before each widget you should use the dynamic_sidebar_params filter. Another post explains this well. Here's the gist of it. function uft_add_nocontent_class($params) { $params[0]['before_widget'] = '<aside id="%1$s" class="widget %2$s nocontent">'; return $params; } add_filter('dynamic_sidebar_params', ...


You should probably be doing this when it's being displayed, not when the sidebar is registered. For example, sidebar.php or whatever variant your theme is using for the sidebar in question. You're probably attempting to change it before it's been set.


Anything to do with using the Google Places API is going to be off-topic here, but the best place to start would be the developer docs. However, how you interact with the API data within WordPress is certainly on-topic. I would suggest a wrapper function that caches the results periodically: /** * Get places data for a post. * * @param int|WP_Post ...

Top 50 recent answers are included