ThemeForest

Wordpress Widget Question?

300 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • United States
  • Referred between 100 and 199 users
GoodLayers says
As you guys know, widget support only this
'before_widget' => "" 
'after_widget' => "" 
'before_title' => "" 
'after_title' => "" 

Any way how to create something like ‘before_content’ and ‘after_content’
I need to insert some html tag after ‘after_title’ and close before ‘after_widget’
Is it possible??

Thanks so much! :)

4 months ago
140 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
  • United States
weblusive says

Why not doing that in the widget itself? When you create the function widget() you can decide about the output, right? To get an idea, let’s think of custom recent posts widget. You create function widget() and you declare there how to show your posts, like in the div or paragraph, etc… so why not adding the before and after output here?
Sorry if the answer is a bit messy, if you need more clarifications, just PM me, I’ll try to help.

4 months ago
300 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • United States
  • Referred between 100 and 199 users
GoodLayers says

Thanks for your reply Weblusive :)

Yes, it’s okay for custom widget. We can do that. But what about standard Wordpress widget ie. calendar, text widget, links. etc…

Is it possible to do?

Thanks!

3 months ago
54 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • Europe
dekciw says
'before_widget' => '<div class="widget">' //starts widget
'before_title' => '<h3>' //starts title
'after_title' => '</h3><div class="WIDGET-CONTENT">' //closes the title, and starts content
'after_widget' => '</div></div>' //closes the content, and then the widget itself.
 

You should get the idea. But.. your markup gonna mess up, if widget won’t have a title.

3 months ago
300 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • United States
  • Referred between 100 and 199 users
GoodLayers says

'before_widget' => '<div class="widget">' //starts widget 'before_title' => '<h3>' //starts title 'after_title' => '</h3><div class="WIDGET-CONTENT">' //closes the title, and starts content 'after_widget' => '</div></div>' //closes the content, and then the widget itself. You should get the idea. But.. your markup gonna mess up, if widget won’t have a title.

Thanks Dekciw, yep we already jumped to this solution but yeh, if no title, it’s mess :(

Thank you

3 months ago
by
by
by
by
by