Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to change widget items in Wordpress

Posted on 2011-09-26
7
Medium Priority
?
333 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 1000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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 1000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
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…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

971 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