iamn00b
Forum Replies Created
-
Forum: Plugins
In reply to: [Widget Logic] 'widget_content' filterHi thanks again for your reply.
I was very excited to try the code you posted, but im not sure if im interpreting what you suggested correctly. below is what im putting in functions.php but its not working. is this what the code should look like?
add_filter('widget_content', 'details_wrapper'); function details_wrapper($content, $widget_id){ if ($widget_id=='extended-categories-3') { echo '<details><summary>' }firstly, i checked for syntax examples of a php if statement and there is a ; missing at end of echo line of code. i tried without and it causes Parse error: syntax error, unexpected ‘}’, expecting ‘,’ or ‘;’ so i tried with the ; and the site loads without parse error but all widgets dont display (all sidebar widgets have dissapeared) so obviously that filter is doing something now since adding the if (widget_id==… code.
my original code so far is the closest ive come to getting it to almost work.
theres still two problems:
1. the details tag is wrapping all widgets instead of specific targeted id widgets.2. the details tag arrow icon for expand/collapse is showing but doesnt seem to expand/collapse the widgets.
they all stay expanded and dont collapse when you click on the details tag arrow.
so does that mean i should be wrapping the details tag around some HTML element WITHIN the widgets output rather than wrapping the WHOLE widgets code. i.e details tag only wrap around <details>summary><H3></H3></summary><details> for example?Forum: Plugins
In reply to: [Widget Logic] 'widget_content' filterHi thanks for your reply.
after i posted i carried on and used the example code provided in Other Notes section as a starting point. below is what i ended up with and trying out. basically this code kind of worked i.e it did wrap widgets with the<details>tag, however it wrapped ALL widgets in sidebar and even my top nav menu widget too which is in header area. so thats why i tried the$widget_idto target specific widget areas e.gid='extended-categories-3', which is theidof the specific avh extended categories widget area. unfortunately even when i added the$widget_id=’extended-categories-3′it still wraps ALL widget areas and doesnt target only that specific widget withid=’extended-categories-3. is there some mistake in the code?`add_filter(‘widget_content’, ‘details_wrapper’);
function details_wrapper($content=”, $widget_id=’extended-categories-3′){
return “<details><summary>$content</summary></details>”;
}
Forum: Themes and Templates
In reply to: choose different Thumbnail for Recent Posts widget in sidebari know but I renamed the RECENT POSTS title to FEATURED JOBS thats all. its still a RECENT POSTS plugin/widget.
Forum: Themes and Templates
In reply to: choose different Thumbnail for Recent Posts widget in sidebarHi thanks for your reply.
The thing is i dont think this is a theme specific query is it?
the solution i found is a third party plugin but the problem is a general wordpress admin one. i.e how do i choose a specific thumbnail to show in the Recent Posts widget sidebar area?
do i have to go into the templates and code?
is there a plug in that offers thumbnail options for recent posts?
are custom fields the answer?
what do i add a new custom field to? to the image file in media library?
or to the post?