Return to Snippet

Revision: 15043
at June 22, 2009 08:39 by mlangfeld


Initial Code
/* My Custom Widget */
02. 
03.add_action('widgets_init', 'my_text_widget_init');
04. 
05.function my_text_widget_init() {
06.  register_sidebar_widget('My Custom Widget', 'my_text_widget');
07.}
08. 
09.function my_text_widget() {
10.if (is_page('about')) {
11.?>
12.<li class="widget">
13.    <div class="my_widget_header">
14.        <h3>Pacific Cruise Line</h3>
15.    </div>
16.<div id="widget_content">
17.    <img class="widget_icon" src="<?php bloginfo('template_url'); ?>/custom/images/calendar_128.png" height="100px" alt="Coffee?" />
18.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mollis, turpis suscipit sodales congue, magna urna egestas erat, vitae pulvinar tortor lorem vitae dolor. Ut sed mauris nisi.
19.</div>
20.</li>
21.<?php
22.}
23.}

Initial URL
http://www.fouroclockproject.com/2009/advanced-sidebar-widget-styling-for-thesis/

Initial Description
This code to be added to custom_functions.php  May also need to add to custom.css to style your custom widget. (This code found towards the end of the article).

Initial Title
Custom widget on selected pages in Thesis WP

Initial Tags
wordpress

Initial Language
PHP