• Hello,

    If in external HTML I do:

    <?php
    define('WP_USE_THEMES', false);
    require('/home/myfolder/www/blog/wp-blog-header.php');
    ?>
    
    <?php
    global $post;
    $args = array( 'posts_per_page' => 5 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />
    <?php endforeach; ?>

    it includes an ad from Google by the plugin “Adsense In Posts”.
    I don’t want it to include that ad, I don’t need it there.

    How to disable?
    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter hero12

    (@hero12)

    🙂 ok, solved…
    once loaded wp-blog-header.php

    you can do something like…

    $plugins = '/home/myfolder/www/blog/wp-content/plugins/adsense-in-posts/adsenseinposts.php';
    deactivate_plugins($plugins);

    now it works as expected

    Thread Starter hero12

    (@hero12)

    NO 🙂
    there’s an issue with this method…

    it also disables the plugin from the WordPress site.

    HOW TO FIX? thanks

    Thread Starter hero12

    (@hero12)

    OK, sorry 😉

    ...
    <?php endforeach; activate_plugin($plugins); ?>
    Thread Starter hero12

    (@hero12)

    nothing to do.. it always displays the ads if I activate the plugin again…

    sorry, but this function is not well implemented…
    is there an easy method to fix it?

    thanks

    Thread Starter hero12

    (@hero12)

    for now I had to disable “don’t show” the ad from “Multiple Posts” but it’s not the solution ’cause in this way I’m forced to not show the ad on WP homepage…

    if you can help really appreciated, thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to disable plugins from wp-blog-header.php integration’ is closed to new replies.