WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Ads on Multisite (19 posts)

  1. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    I'd like to put an ad banner across the top of all blogs on my Multisite install, but there doesn't seem to be a good way to do it. I've looked for plugins, etc., but there just doesn't seem to be anything out there. Any suggestions of where I should put the code?

  2. elfin
    Moderator
    Posted 4 years ago #

    In the theme?

  3. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    I'm assuming it will have to go inside the theme. When it I try to put the code anywhere else it doesn't show up properly.

  4. I put mine in widgets, using plain text (or the php widget plugin). Works fine there.

    Where were you trying to put them?

  5. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    At the top of the page on a MULTISITE install. I want the ads to show up on ALL sites.

  6. Sorry I misspoke. By where I meant via what method were you using to put them there?

    HOW were you trying to put them there?

  7. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    I'm trying to find a place in the code where it makes sense to put the code. The ideal place would be right under the <body> tag, but there's no way to do that as the header templates all go past that point in the code. It doesn't really matter to me where it goes, as long as it shows up when people load the page.

  8. This is what confused me:

    I'm assuming it will have to go inside the theme. When it I try to put the code anywhere else it doesn't show up properly.

    Where ELSE outside of the theme were you TRYING to put it that it was failing?

    Anyway. Edit your theme to put it where YOU want it. :) Seriously.

    If your theme has widget sections (like 'header' and 'footer') you could put the code into a text widget and put it in those sections, but if not then you'll have to find where, in your theme, you want it, and paste the code in.

  9. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    Your missing the point. It's a MULTISITE install. There are over 1500 blogs on the site. It needs to show up on ALL of them, not just mine. There is no plugin or guidance on this that I can find anywhere. Where do I put the code for the ads? I can't do it by editing a theme as there are over 100 themes here people can use.

  10. elfin
    Moderator
    Posted 4 years ago #

    Actually, and andrea_r might correct me here, but could it be added via the wp_footer (then styled to be positioned where ever you like) via a plugin. I believe multisite still has the ability to run a plugin that affects every site but is only configurable by the main one.

    If you add it directly to a theme you would have to add it to every theme that is available for use but the sub sites. if you only have a handful, then it is relatively easy. Otherwise I would have to suggest the plugin route.

  11. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    I've actually thought of that. I suppose it is possible, but I'd have to do absolute positioning on the thing and I must say that didn't work out real well. Also, the wpaminbar pluging does this, and I tried to emulate it, but to no avail, at least so far. It does appear though that wp_footer is the way to go as nothing else is working.

  12. elfin
    Moderator
    Posted 4 years ago #

    Well you might need to also include some style into wp_head as well, but yeah a plugin is the route I'd take personally.

  13. Actually, and andrea_r might correct me here, but could it be added via the wp_footer (then styled to be positioned where ever you like) via a plugin.

    Yep. that's basically what you do. yes, it is doable, yes the admin bar plugin is a good place to start. (done it before)

    Or use a theme framework on all the sites that has hooks in places in the header where you want.

  14. Stop shouting (we're trying to help, and I didn't miss the point, thanks).

    Are you using the same theme for all sites? If not, then no matter WHERE you put the ad, it might not work on all sites. You could end up breaking someone's site down the line.

    On the other hand, if every site has the same theme, or one of a few listed themes, you can still manually edit each one for optimum layout. Gives you more flexibility. 10,000 sites not-withstanding, you may not want the exact same style of ad per site.

    And you never answered "Where ELSE outside of the theme were you TRYING to put it that it was failing?" I didn't want to retrace steps you'd already done.

    If you do it via a homegrown plugin, put it in the mu-plugins folder. I actually DON'T recommend that, as not every theme will work equally well. If it's a site where you are always going to control the themes, then sure, it could work, but you'll have to test each theme to make sure layout is correct.

  15. Nicholas Fitzgerald
    Member
    Posted 4 years ago #

    Ok, here's what I got so far: 1. It's ok to shout, but only AFTER asking someone else not too. 2. There is no possible solution that does not include going through the process of creating a plugin. 3. I'm probably not going to be able to use any of the information I here. I guess I'll have to figure it out for myself. I'll let you know how to do this once it's working.

  16. I wasn't shouting either (but you see how it gets misread so easily?)

    Anyway, yeah, it's a plugin or editing each theme.

    You may want to look at http://wordpress.org/extend/plugins/wordpress-admin-bar/ for how to implement a sitewide sort of 'bar'.

  17. the reason you haven't found a plugin is becasue there is no standard hook in every wordpress theme to display something in the header area of the theme (there is wp_head but that's different).

    And some people use caps to emphasize. ;)

    I *did* give ideas on what other people have done. no, you do not have to code a plugin from scratch but you *will* have to do some work with previously mentioned plugins to get exactly what you want. (see: no hooks in themes in the header area)

    A non-plugin solution is to use a theme (I have a paid one in mind here) that *does* have hooks in the header area, and does exactly what you want with a wee bit of setup, assuming you use that theme or various child themes on every single blog.

  18. Vichingo
    Member
    Posted 3 years ago #

    Well, I have a rather similar but a lot easier problem. To begin with I must say that my blog theme is Coraline.

    I'm new in Adsense and I already put 2 content ads as widgets in the sidebar, and 1 content ad on top of a post title when post is, that is when ready to leave a comment.

    However, when in the main page, the visitor can read up to 10 posts without seeing this 3rd ad. In order for visitors to see it they have to open the post by clicking on its title. That's the way Coraline theme works.

    What I'd like to to is not no put the 3rd ad where it's now but just in the very top of the blog, just above the blog name or below the blog image, so that it'll be visible for visitors regardless the page they are displaying or eve if they don't open any post.

    Enter as Admin in my host cPanel I have tried to paste the banner ad code in different positions of different places (header.php, image.php, page.php, and single.pho) without success.

    Can anybody tell me where in Coraline theme should I paste Adsense banner code so that the associated ad be displayed where I said before?

  19. You'd be better off asking this in the theme section for Coraline : http://wordpress.org/tags/coraline?forum_id=5

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.