For some time now, I have been using the Arras theme for WordPress on my website. The theme is pretty good compared to a lot of other themes and it has a very nice, professional, clean look and feel. It also sports a nice “Featured Post” slider on the front page, which makes the theme look even fancier.
However, I decided to use the Featured Content Gallery plugin for the generation of the “Featured Content” slider because it did offer a few more features and the slider did look a bit more professional.
Unfortunately, the Featured Content Gallery plugin (like many other such plugins) requires that all the posts that are to be “featured” be added to a specific category. Since, up to now, all my posts have been “featured” and there was no need for special category, I did not want to create one now just so I can include posts in the slider.
That’s when I got the idea to change the plugin so it will also accept a specific tag instead of a category. This way, I could add a tag to all the posts that I want to be “featured” and the slider will still work as designed.
Below, I will describe the changes that I made to enable using a tag for the slider.
- The first thing to do is to add support for selecting to use a tag versus any of the other, already available options. This means editing the options.php file in the plugin’s directory (wp-content/plugins/featured-content-gallery):
- After the line
$gallerynewway = get_option('gallery-way') == 'new' ? "checked" : "";add the following line:
$gallerytagway = get_option('gallery-way') == 'tag' ? "checked" : ""; - Change the width of the table from 690 pixels to 990 pixels:
<table width="990" border="0" cellpadding="0" cellspacing="7">
- Add the new radio button to the selection – after the lines:
<input type="radio" name="gallery-way" id="gallery-way" size="25" value="new" <?php print $gallerynewway; ?>> Select here to use individual post or page IDs </td>add the following new HTML code:
<td width="300"> <input type="radio" name="gallery-way" id="gallery-way" size="25" value="tag" <?php print $gallerytagway; ?>> Sellect here to use tag selection </td>
- Add the new text entry where the tag name will be entered – after the lines:
Post or Page IDs <span>(comma separated no spaces)</span>:<br />; <input name="gallery-items-pages" id="gallery-items-pages" size="25" value="<?php echo get_option('gallery-items-pages'); >"></input> </td>add the lines
<td> Tag Name:<br /> <input name="gallery-tag" id="gallery-tag" size="25" value="<?php echo get_option('gallery-tag'); ?>"></input> </td> - Finally, add the new option that we’ve created (gallery-tag) to the list of plugin options – replace the line
<input type="hidden" name="page_options" value="gallery-width,gallery-height,gallery-info,gallery-items,gallery-border-color,gallery-bg-color,gallery-text-color,gallery-use-featured-content,gallery-use-thumb-image,gallery-way,gallery-items-pages,gallery-category,gallery-fcg-button,gallery-fade-duration,gallery-delay,gallery-randomize-pages,gallery-rss-word-quantity,gallery-default-transaction" />
with the line
<input type="hidden" name="page_options" value="gallery-width,gallery-height,gallery-info,gallery-items,gallery-border-color,gallery-bg-color,gallery-text-color,gallery-use-featured-content,gallery-use-thumb-image,gallery-way,gallery-items-pages,gallery-category,gallery-tag,gallery-fcg-button,gallery-fade-duration,gallery-delay,gallery-randomize-pages,gallery-rss-word-quantity,gallery-default-transaction" />
(Notice the the new “gallery-tag” appearing after the “gallery-category” string)
- After the line
- Now, that we can select to use a tag and input which tag that would be, let’s change the code that generates the slider to use that tag. This change is in the gallery.php file:
- There is only one edit that new need to make here – allow for the use of the new tag selection mechanism. Fin the line:
<?php query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items')); ?>and replace it with the following code:
<?php if (get_option('gallery-way') == 'tag') $cust_query = 'tag=' . get_option('gallery-tag'); else $cust_query = 'category_name=' . get_option('gallery-category'); query_posts($cust_query . '&showposts=' . get_option('gallery-items')); ?>
- There is only one edit that new need to make here – allow for the use of the new tag selection mechanism. Fin the line:
- Finally, we’ll have to add the tag to all the posts that we’d like to appear on the slider. This is done in the Posts->Edit screen of the Admin panel. You can select all the posts and add the tag at once so you won’t have to do it for every post, individually.
An unfortunate side effect of this is that if you are using a Tag Cloud plugin on your WordPress site, the tag that you’ve selected to use for the slider will most likely end up being the most used tag and will appear boldest.
An easy fix for this is to edit the plugin/widget’s call to wp_tag_cloud and exclude that tag using the ‘exclude=’ argument.

Wow Mitko! You did a great job on the site. Don’t be mad if I try this theme out on ours!
Thanks, Dave! Let me know if I can help?
Hi!
Suddenly my slider is not working, please please please can You help me
thanks
Dario
Dario,
You seem to have a problem with the superfish plugin. When I inspect your page, I see the following error:
has no method ‘superfish’
Uncaught TypeError: Object #
Try disabling the plugin and see if that fixes the problem.
Hi mitko, i admire your skills on WP editing, im a newbie in PHP and would like to have some help regarting to arras theme.
1. what photo gallery did you use on your website?
2. when i click on a category, it shows a thumbnail on the left side and some text info in the right side. how did you do that?
3. if possible, can i have a copy of zip files of your edited arras theme? so i can have and take a look on what you’ve done, since im only new to PHP, it’s hard for me reading and editing PHP-wordpress codes. Thanks
Hi xavthine,
Thanks for your comment!
1. The photo gallery that I used was the NextGen Gallery plugin. You can get from http://wordpress.org/extend/plugins/nextgen-gallery/.
2. What you are seeing is part of the Arras theme. What I did is go to the Layout tab of the Arras Theme configuration and choose “Quick Preview” from the “News Display Type” drop down menu.
3. Sure, I should be able to put something together in the next few days and I can point you to a download. Please, check back here later.
great mitko, since i am a fan of arras theme, i think i will be more often visiting your site, thanks again for the help. Very appreciated! More power bro.
Thanks xavthine! Here is a link to a download of my modified Arras theme.
link
<>>
the download link does not exist any more???
can u please provide it again???
I have updated the link in the original comment. I am also including it here as well: download link
How I can correct this issue?
Warning: substr_compare() [function.substr-compare]: The length cannot exceed initial string length in /home/a6874786/public_html/wp-content/plugins/wp-gallery2/lib/gallery.php on line 43
Danny,
This doesn’t seem to be related to this post but I believe what is happening is that the length of your URL is shorter then 8 characters. What is the URL that you put in your plugin configuration?
Hi and conglatulations for your great site!
I use Arras Theme and i want to add a featured slideshow like yours…
How can i do it? Is there any plygin or i should parameter smth?
I will be glad if you give me an answer..
dinosg,
Unfortunately, it isn’t a plugin or an easy change. I created the featured slideshow on my front page as part of my custom Arras child theme.
If there is any interested, I can try and put some posts together on how I did that over the Holiday break.
For a reference, I used a guide to create my slideshow. Here is the link to it – http://webdeveloperplus.com/jquery/featured-content-slider-using-jquery-ui/
You have an incredible site. I particularly like the slider with the thumbnails. Can you help me with code to make it do the following:
I would like to be able to have minithumbnails of each picture in the slider show underneath the slider and if you click on that minipix the slider shows that info – it would like this site: http://www.mysalesandmanagementtraining.com/
I am not a professional webbuilder and don’t know all the lingo but I can cut and paste with the best of them!
Thanks in advance for looking at this!
Melody,
While it is possible to duplicate the look of that slider, it won’t be an easy thing for me to do so it will take a while. However, you might want to look at the Featured Content Gallery slider which has the functionality which you are looking for (take a look at the “Featured Content” link in the top right-hand corner).
good job. I wanted to be able to do this and do not depend on the choice category. Thanks a lot.