Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter markwf

    (@markwf)

    Ta muchly for the reply.

    Script debug revealed nothing.

    My last attempt at getting to the bottom of this has been to deactivate all plugins, one at a time, that have been updated in the last week.

    I can’t remember when WordPress itself was updated but in its root directory “readme.html” and “licence.txt” have a date of 10 Oct 2021.

    I’m starting to suspect that a recent WordPress update may be the culprit here. If so that’s one of the dangers of allowing auto updates.

    If you need any more info please ask.

    Cheers,
    Mark F…

    Thread Starter markwf

    (@markwf)

    Hi Thomas,

    I know it’s been a LONG time but…
    I got the corruption problem and the understanding of child themes sorted but then had to take a bit of a holiday from playing with my web site.
    I’ve now got the ad (one per page) where I want it but I’m struggling with the vertical size.
    If you look at jandmf.com you’ll see that the ad at the top is quite high and I’d like to make only a third to half the height it is now. I’m happy with the ad being full width but it’s too high.
    So, my question is, how can I limit the vertical size ?
    Cheers,
    Mark F…

    Thread Starter markwf

    (@markwf)

    Thanks for that Thomas. I was in the middle of testing last night and we had a power failure. When the power returned I find that I have a corupted wp_posts table primary index which is now being stubborn and resisting all attempts to repair it.
    Oh well. Such is life. I’ll get back to you when I’ve repaired this latest SNAFU.

    Cheers,
    Mark F…

    Thread Starter markwf

    (@markwf)

    Hi Thomas,
    Thanks for that. I am in fact using your plugin.
    The functions.php is in a child theme and as far as I’m aware it won’t be overwritten when the theme is updated. The theme I’m using is twentysixteen and I’ve created a twentysixteen child theme.
    What I’m trying to accomplish is to have two ads per page. One at the top above the menu and the other at the bottom of the sidebar. If I let adsense place them I get a big one between the menu and the header image which, to me, is unsightly. I also get ads placed within the content which I’ve been told is not good for a uer trying to read stuff.
    If I put the code snippet in the main theme header.php it comes out in the right place. If I could get it working in the child theme it’d never get overwritten by an update.
    It would be really good if I could use the <?php……?> snippet in the child theme function.php and get the ad between the top of the page and the menu. How it is now but with an ad with a smaller height would be perfect.
    I use the shortcode in a text widget in the sidebar and it works well.

    Cheers,
    Mark F…

    Thread Starter markwf

    (@markwf)

    Hi again all,
    I’m still struggling with this. If I put the google code snippet “if( function_exists(‘the_ad_placement’) ) { the_ad_placement(‘advert-1’); }” in a suitable place in header.php I get the advert appearing where I want it.
    However. If I put it in functions.php in a child theme –
    ————————————————–
    function adsense_above_menu() {
    <?php
    if( function_exists(‘the_ad_placement’) ) { the_ad_placement(‘advert-1’); }
    ?>
    }
    —————————————————–
    it fails with the live preview. All I get is a text page with “function adsense_above_menu() { } add_action(‘wp_body_open’, ‘adsense_above_menu’ ); ” at the top of the page.
    This has got me well and truly stumped. I’m probably missing something truly fundamental but I don’t know what.

    Cheers,
    Mark F…

    • This reply was modified 5 years, 1 month ago by markwf.
    Thread Starter markwf

    (@markwf)

    Ta heaps for that.
    Although I didn’t go with a child theme (I need to do some more experimenting first) I found a handy place to put the php snippet in header.php. Once I turned off “auto placements” in AdSense I get the effect I’m after.
    I guess as long as the 2016 theme doesn’t get updated I’ll be OK.
    Now all I need to do is to reduce the height of the ad by about 30% and I’ll be a happy camper.
    Ta heaps.

    Cheers,
    Mark F…

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