Hi everyone, I've been going crazy trying to find what I assume is simple code. I would like to edit my wordpress theme to place adsense blocks inside my first and second posts on index.php, and twice inside the post on single.php. I've been looking for this code like crazy, but I keep coming across the same code over and over again to place the ads above and below the posts (which I already know how to do). Basically, I would like the ads to appear where they appear in the articles on this page here. I used to know of a nifty code to do this, but I can't remember what it is now. Any help on hard coding this would be appreciated, unless you know of a plugin that can do exactly what I'm looking for, without me having to change out code all the time as I post new articles.
Have you searched any adsense plugins...That will save your Time. Try use quick adsense plugin.With knowing all options you can set like that.All the best.
Yes, I haven't found any plugins that will do what I want. Most add the code to articles on single.php, and above and below the articles on index.php. I'd really like to learn how to code this. When I had the correct code before, I didn't know enough php to understand it. Now that I think I'll be able to understand it, I cant find the code.
The theme is being developed on my localhost, so I wouldn't be able to share it with you until after I upload it. I can't upload it yet, since it's going onto an existing site which already gets a fair amount of traffic. Bharatmax, I think I may have spoken to soon. That plugin is pretty powerful, and may even do exactly what I need. I'm experimenting with it right now. I'd still like to know how to actually hard code this, for the sake of learning, but the plugin might solve the problem for now.
OK, I published the theme, perhaps you guys can help me out with another issue. I need to center the link unit above the menu and article (directly under header). I tried using css margin left and right, but it's not centering on a 1080p monitor. It seems to center alright for lower resolutions, but not higher ones. Does anyone have any ideas? Website is Photoshop for Photographers. I used a theme hook on the functions.php file to include the link unit. Also, any ideas to add a search box to the right side, inside the header? I used this code: // This will create your widget area function my_widgets_init() { register_sidebar(array( 'name' => 'Header Aside', 'id' => 'header-aside', 'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">', 'after_widget' => "", 'before_title' => "<h3 class=\"widgettitle\">", 'after_title' => "</h3>\n", )); } add_action( 'init', 'my_widgets_init' ); // adding the widget area to your child theme function my_header_widgets() { if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) { echo '<div id="header-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n"; dynamic_sidebar('header-aside'); echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n"; } } add_action('thematic_header', 'my_header_widgets', 8); Code (markup): to include it in my widgetized areas, and then tried to use this css /* Moves blog name & description to the left */ #branding { float: left; width: 620px; } /* Moves the new widgetized area to the right and levels it with #branding */ #header-aside { float: right; width: 300px; padding: 88px 0 44px; } /* This will clear the floats and keeps the access bottom line from jumping into the air */ #access { clear: both; } Code (markup): to move it to the right side, inside the header, but it moves to the right side outside the header. Any help is appreciated. Thanks. EDIT: I would also like to move the link unit down, closer to the content area, while keeping the same amount of space between the header and the content area.