How to hide a script ( an ad) from a specific post? [closed]

You can do something like this : // remove the script from the queue if were are on the post ID 11 add_action(‘wp_enqueue_scripts’, ‘remove_script_specific_post’); function remove_script_specific_post(){ if( 11==get_the_ID() ){ wp_dequeue_script(‘my_script_handle’); } } Provided that the script has been added with wp_enqueue_script

Showing ads after posts in home page

I don’t believe the code worked what you have posted. If you simply copied and pasted it from your template, it would never have worked. There are a couple of syntax errors/bugs in your code <?php if((have_posts)): ?> should be <?php if(have_posts()): ?>. <?php $count ?> What does this mean. This is suppose to update … Read more

How to prevent Google adsense invalid impressions while performing admin tasks on my wordpress site?

The advertisements are only displayed on the Front-end of your site (whatever the visitors see). Since the ads are only displayed on the front-end, you don’t have to worry about generating invalid impressions by reloading your admin page, creating posts, etc. So long as you don’t open your website’s front-end area and start reloading like … Read more

Temporary download page or restrict static download page based on how the user got to the page?

For your first question “Detect where they are coming from”, Just check the $_SERVER[‘HTTP_REFERER’] for your expected web address. For the second “Create a short lived page”, your answer lies in the set_transient() method. You can do something like: function create_page() { if ( get_current_user_id() ) return “<html>…</html>”; return false; } function get_page( $unique_id ) … Read more

Can I use widgets & shortcode if I need to return an array?

I think that your proposed solution, or plan of attack, is far more complicated than it needs to be. You can use a static variable to manage this. Proof of concept: function shortcode_with_static_data($atts,$content) { static $ids; $ids[] = time(); var_dump($ids); // you should return a string not dump data in a real shortcode } add_shortcode(‘scwsc’,’shortcode_with_static_data’); … Read more

Assign specific ads to specific categories/posts

You have attempted to paste your PHP into a text widget. and the tags have been transformed. <div class=”textwidget”> <!–?php if (is_category(‘5′)) { ?–> You can’t execute PHP from a text widget by default, and I would not recommend trying to do so (it should be possible). Instead, it is trivial to build your own … Read more

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