Solved

how to change widget items in Wordpress

Posted on 2011-09-26
7
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part I (http://www.experts-exchange.com/Web_Development/Blogs/WordPress/A_8410-Getting-Started-In-WordPress-Part-I.html), I introduced you to the powerful WordPress backend, the WordPress administrative Dashboard.  In Part II, I will introduce yo…
WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

763 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