Solved

how to change widget items in Wordpress

Posted on 2011-09-26
7
319 Views
Last Modified: 2012-05-12
In a Wordpress site I'm trying to change the list of portfolio items shown in the sidebar.

More specifically I'm trying to:
- add a hyperlink to the portfolio thumbnails
- remove the date
- filter the portfolio items so that I can make a distinction between portfolio and blog items

Surely this most be configurable somewhere, but I don't know where to look.
Any suggestions?
sidebar-widget.php.jpg
0
Comment
Question by:digital1stein
  • 4
  • 2
7 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 250 total points
ID: 36599527
The first place to look is in the Dashboard under Appearance | Widgets for the widget in question.  If it is a plain text widget, then all you need to do is add/remove the desired HTML.

If you can't alter the widget from there and this widget is added via a plugin, check the plugin settings screen (if any).  If there isn't a settings option for this plugin or if the widget is hardcoded into the theme, you'll need to edit the php files for either the plugin or the theme to get what you want.
0
 

Author Comment

by:digital1stein
ID: 36599781
Thanks for the quick reply.

I don't think it's a plain text widget (see screenshot).
 Dashboard > appearance > widgets
I can edit the code of the sidebar-portfolio.php file that is responsible for showing the widget (attached).
But I don't see the code that is effectively responsible for showing the individual items.
<?php

/* ------------------------------------------------------------------------------------------------------------

	Sidebar template - Portfolio
	
------------------------------------------------------------------------------------------------------------ */

?>

	<?php global $domain; /* The unique string used for translation */ ?>

	<?php 
		
		/* Reset to the default query */
		wp_reset_query();
		
		/* Get the custom fields values */
		$post_custom = get_post_custom($post->ID);

	
		/* Get special sidebar if it exists */
		if(isset($post_custom['jw_sidebar'][0])){ $sidebar_name = $post_custom['jw_sidebar'][0]; }else{ $sidebar_name = 'Portfolio Widgets'; }

		
	?>
	
	<div id="column" <?php if(isset($post_custom['jw_layout'][0]) && $post_custom['jw_layout'][0] == 'layout_sc'){ ?>class="left-column"<?php } /* If sidebar + content layout get the left sidebar */ ?>>
		
		<?php 
if (function_exists('dynamic_sidebar') && dynamic_sidebar($sidebar_name)):else:

?>
			
			<!-- No widgets START -->
			
			<h4><?php _e('No Widgets Added Yet', $domain); ?></h4>
			<p><em><?php _e('Please add them in the WordPress admin page under Appearance &rarr; Widgets. The widget section is', $domain); echo ' "'.$sidebar_name.'".'; ?></em></p>
			
			<!-- No widgets END -->
			
		<?php endif; ?>

	</div><!-- #column -->

Open in new window


So my guess is I should be looking elsewhere.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 36599981
Right, that code appears to set the JW widgets list for Appearance | Widgets.  Is this a plugin or a theme?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 31

Assisted Solution

by:gwkg
gwkg earned 250 total points
ID: 36601057
Check in your theme folder

functions/widgets/widget.recent-posts.php
0
 

Author Comment

by:digital1stein
ID: 36918558
Hi,

Sorry for responding so late; I was out for more than a week.

Jason1178, I have a separate theme. Don't think it's a plugin (attached you'll find a screenshot of my plugins page).

Gwkg, I watched the widget.recent-posts.php file (attached), but I couldn't find where to add a link to the thumbs.

Any other suggestions?
plugins.jpg
widget.recent-posts.php
0
 

Assisted Solution

by:digital1stein
digital1stein earned 0 total points
ID: 37041687
Hi, just wanted to let you know that after a lot of looking I found the solution.
I had to dive in the shortcodes.php file (themes>xxxxx>functions>shortcodes.php)
and change some params there.

Anyway, thanks for your help in assisting.
0
 

Author Closing Comment

by:digital1stein
ID: 37061305
I found the solution myself meanwhile, but appreciated the help of the other EE members.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now