Solved

how to change widget items in Wordpress

Posted on 2011-09-26
7
320 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

867 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

21 Experts available now in Live!

Get 1:1 Help Now