Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   [SOLVED] How to create a new widget (http://forum.bytesforall.com/showthread.php?t=5223)

bigliettaio Jan 9, 2010 10:36 AM

[SOLVED] How to create a new widget
 
Hi,
is it possible to create a NEW WIDGET not a NEW WIDGET AREA?
What i want to mean is if i possible to create a widget who will appears listed on:

Admin Panel>>Appareance>>Widget

?

Thnx

paulae Jan 9, 2010 10:44 AM

Some widgets are included with Wordpress. Some are included with Atahualpa. Others can be downloaded as plugins from wordpress.org in the Extend area. Some plugins create widgets when they are activated, to accomplish some task in a sidebar. Thousands of smart people are writing new widgets all the time.

You can also create your own widget using the Text widget, if you want to put some text or HTML in a sidebar. For instance, you might want to say, "This is my web site" in the sidebar. Just use the Text widget, type that text in it, and save it. Or put the HTML for an image there.

You should read about widgets and plugins at wordpress.org. It's fun.:)

bigliettaio Jan 9, 2010 12:21 PM

Hi Paulee,
and thanks for your usual answers:-)
i have already customize my sidebar adding Text and using some plugin to show
Recent Posts of each category ONLY in post belonging to a specific category but i would like that my own widget appearing in the same way as Recent Post Widget.
There's is a function in atahualpa to customize in a very easy manner my widget with
ATO>>Style Widget & Sidebar>>Style widget settings?

Cheers

juggledad Jan 10, 2010 05:25 AM

bigliettaio,
I think you are misunderstanding what you have done so there is a communications issue here.

A widget is a piece of code that you write that performs some action, like...list the authors of the last 5 posts.

Some widgets allow you to put more than one occurance of the widget in the sidebar, others do not. That is controled by the actual code of the widget (look at the PHP code of the plugin)

Anything that is done in a widget - weither it is adding options to it or giving it a title, is entirely controled by the widget NOT THE THEME. This is why you can switch themes and still have the widgets in the sidebar running (with the exception of any widgets that are theme dependent)

So the answer to your question is NO. Atahualpa has no options to control the plugins, that is done by the plugins themselves.

paulae Jan 10, 2010 06:43 AM

The theme options let you style the way the widget looks, like the font, size, color, etc.

bigliettaio Jan 12, 2010 04:14 PM

Quote:

Originally Posted by juggledad (Post 22578)
bigliettaio,
I think you are misunderstanding what you have done so there is a communications issue here.

A widget is a piece of code that you write that performs some action, like...list the authors of the last 5 posts.

Some widgets allow you to put more than one occurance of the widget in the sidebar, others do not. That is controled by the actual code of the widget (look at the PHP code of the plugin)

Anything that is done in a widget - weither it is adding options to it or giving it a title, is entirely controled by the widget NOT THE THEME. This is why you can switch themes and still have the widgets in the sidebar running (with the exception of any widgets that are theme dependent)

So the answer to your question is NO. Atahualpa has no options to control the plugins, that is done by the plugins themselves.

Maybe i do not explain myself in a right way.
What i want to do is customize my text widget [ who i talked about here] in a way that is the same setting for recent posts widgets
SO to have the same layout for widgets actived who listed posts in my blog.
That' is all.
Do you suggested me to open a threat on wordpress forum of WP category post plug in?

paulae Jan 12, 2010 05:14 PM

In that case, you could look at the CSS for that plugin's widget and use the theme's CSS inserts to style the new widget the same way.

bigliettaio Jan 19, 2010 06:13 AM

So customizing of textwidgets for category posts only is done.

I customized this list code of listamatic
using the div for Widget Content Box :
div.textwidget
as explained in
ATO>>Sidebars & Widgets>>Style Widget
and now

Recent Posts Widgets and Category Posts Textwidget are shown in the same way

BUT there is a problem:
every text widgets using in my sidebar has a border.

[here an example:
the right sidebar of this post belonging to "Rugby" category has two text widgets:
1st a banner
2nd category posts lists
as yuo can see also the banner has a left border]

How can i do to specify that css that i wrote must be executes only to specified textwidget?

1) every text widget DIV has an id="text-decimalnumber" :

<div id="text-11" class="widget widget_text">
<div class="widget-title">
<h3> XXX</h3>
</div>
--------
</div>
</div>

how to use this in my CSS list code?

Code:

div.textwidget li {
        list-style-type:none;
        display:block;
        width:auto;
        margin-bottom:2px;
        }

div.textwidget a {       
        color:#666666;
        font-weight:normal;
        border-left:7px solid #3EAFAF;
        text-decoration:none;
        padding:0 0 0 5px;
        display:block;
        }

div.textwidget a:hover {
        color:#000;
        font-weight:normal;
        border-left:7px solid #4B61D1;           
        display:block;
}

2)nd inserting a class in php code using in textwidget?

<?php wp_cat_posts(); ?>

plugins used :
-Category post widget &
-PHP Exec

Thnx

juggledad Jan 19, 2010 06:26 AM

CSS Selectors use ID's (#myid) or CLASS's (.myclass) the difference is that a CSS selector with a class will apply to all the elements with that class where an ID can only be used once - each ID is (suppose to be) unique.

So in this case you don't want to use 'div.textwidget' because that will effect all widgets with a class of 'textwidget'. You want to use 'div#text-11' since that only occure once, so these rules will only apply to that element.

bigliettaio Jan 19, 2010 08:07 AM

Optimum JD.
I just try it an it run :)
now i' m going to add this for every textwidget category post!

Many thankx


All times are GMT -6. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.