Goedemiddag heren,
Ik zit momenteel met een probleempje.. Zojuist heb ik een wordpress theme geinstalleerd dat vele ads opties heeft, echter hebben deze widgets enkel de mogelijkheid de url en image aan te passen en niet meteen een adsense code in te plakken.
De ad lijd naar het betand 'widget-ad300x250.php'
Hier ergens.. moet dus mijn adsense code komen.. maar ik heb er echt de ballen verstand van. Weet iemand snel waar deze moet? of wat aangepast / verwijderd moet worden?Code:<?php /* * Plugin Name: Custom 300x250 Ad Unit * Plugin URI: http://www.ormanclark.com * Description: A widget that allows the selection and configuration of a single 300x250 Banner * Version: 1.0 * Author: Orman Clark * Author URI: http://www.ormanclark.com */ /* * Add function to widgets_init that'll load our widget. */ add_action( 'widgets_init', 'tz_ad300_widgets' ); /* * Register widget. */ function tz_ad300_widgets() { register_widget( 'TZ_Ad300_Widget' ); } /* * Widget class. */ class tz_ad300_widget extends WP_Widget { /* ---------------------------- */ /* -------- Widget setup -------- */ /* ---------------------------- */ function TZ_Ad300_Widget() { /* Widget settings */ $widget_ops = array( 'classname' => 'tz_ad300_widget', 'description' => __('A widget that allows the display and configuration of of a single 300x250 Banner.', 'framework') ); /* Widget control settings */ //$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'tz_ad300_widget' ); /* Create the widget */ $this->WP_Widget( 'tz_ad300_widget', __('Custom 300x250 Ad', 'framework'), $widget_ops, $control_ops ); } /* ---------------------------- */ /* ------- Display Widget -------- */ /* ---------------------------- */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); $ad = $instance['ad']; $link = $instance['link']; /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ if ( $title ) echo $before_title . $title . $after_title; /* Display a containing div */ echo '<div class="ads-300">'; /* Display Ad */ if ( $link ) echo '<a href="' . $link . '"><img src="' . $ad . '" width="300" height="250" alt="" /></a>'; elseif ( $ad ) echo '<img src="' . $ad . '" width="300" height="250" alt="" />'; echo '</div>'; /* After widget (defined by themes). */ echo $after_widget; } /* ---------------------------- */ /* ------- Update Widget -------- */ /* ---------------------------- */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ $instance['title'] = strip_tags( $new_instance['title'] ); /* No need to strip tags */ $instance['ad'] = $new_instance['ad']; $instance['link'] = $new_instance['link']; return $instance; } /* ---------------------------- */ /* ------- Widget Settings ------- */ /* ---------------------------- */ /** * Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function * when creating your form elements. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => '', 'ad' => get_bloginfo('template_directory')."/images/banner-300x250.gif", 'link' => 'http://www.ormanclark.com', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <!-- Widget Title: Text Input --> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'framework') ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" /> </p> <!-- Ad image url: Text Input --> <p> <label for="<?php echo $this->get_field_id( 'ad' ); ?>"><?php _e('Ad image url:', 'framework') ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'ad' ); ?>" name="<?php echo $this->get_field_name( 'ad' ); ?>" value="<?php echo $instance['ad']; ?>" /> </p> <!-- Ad link url: Text Input --> <p> <label for="<?php echo $this->get_field_id( 'link' ); ?>"><?php _e('Ad link url:', 'framework') ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'link' ); ?>" name="<?php echo $this->get_field_name( 'link' ); ?>" value="<?php echo $instance['link']; ?>" /> </p> <?php } } ?>
Met vriendelijke groet,
Justin
- wordpress ads widget -> adsense
-
03-07-2011, 11:20 #1
- Berichten
- 481
- Lid sinds
- 16 Jaar
wordpress ads widget -> adsense
-
In de schijnwerper
Handeczeem.nl | 1.9k EMD zoekvolume | Medisch domeinDomein te koop(Premium) Hoge DA Backlink | DR 95 | RD 4,2 MiljoenAdvertentieruimteAutoriteit links aangeboden | Hoge DR & DA + Duizenden bezoekers. Alle NICHES vrijwelOverige dealsZwangerschapInWeken.nl DA10 - Zwangerschapskalender - Calculator - Veel contentWebsite te koop
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic