Solved

how to change widget items in Wordpress

Posted on 2011-09-26
7
327 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

751 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