Title of the image instead of the Link icon

Modern, responsive, unique and elegant one-page WordPress theme to showcase your creativity
GK User
Thu Jul 11, 2013 10:32 am
Hi there,
is it possible to modify the widget in order to have what in the subject??

See below example with Steak Pie:
Schermata-2013-07-11-alle-11.23.10.jpg


Thanks
Stefano
www.movi-menti.it
User avatar
Fresh Boarder

GK User
Fri Jul 12, 2013 10:00 am
Hey.
Please send me a PM with:
1. URL to your website
2. login and password of user with admin/super-admin privileges (please create one for me)
3. ftp data (host, user, password)
4. link to this thread
User avatar
Moderator

GK User
Thu Jul 18, 2013 11:49 pm
Bey,

Any updated on this topic?

Did you receive my PM?

Cheers
Stefano
User avatar
Fresh Boarder

GK User
Fri Jul 19, 2013 8:25 pm
Sorry, didnt get it :/
Could You send it again - I'll work on this matter in monday.
User avatar
Moderator

GK User
Mon Jul 22, 2013 9:54 pm
Changes made :).

For those who would like to know how - it is a customization that requires editing of few files and have to be done again after updating template.
Files to edit:
/wp-content/themes/Creativity/js/widgets/portfolio.js
/wp-content/themes/Creativity/css/extensions.css

portfolio.js - replace:
Code: Select all
   // add overlays
   widget.find('.gk-image').each(function(i, img) {
      img = jQuery(img);
      if(img.find('.gk-img-overlay').length == 0) {
         // create overlays
         var overlay = jQuery('<div class="gk-img-overlay"></div>');
         overlay.html('<span></span>');
         img.append(overlay);
         // add overlay events
         img.mouseenter( function() {
            var overlay = img.find('.gk-img-overlay');
            var realImg = img.find('img');
            overlay.css({
               'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
               'width': realImg.width() + "px"
            });
            overlay.attr('class', 'gk-img-overlay active');
         });

         img.mouseleave(function() {
            var overlay = img.find('.gk-img-overlay');
            overlay.attr('class', 'gk-img-overlay');
         });
      }
   });

with:
Code: Select all
   // add overlays
   widget.find('.gk-image').each(function(i, img) {
      var img = jQuery(img);
      var title = jQuery(img).attr('title');
      if(img.find('.gk-img-overlay').length == 0) {
         // create overlays
         var overlay = jQuery('<div class="gk-img-overlay"></div>');
         overlay.html('<span><i>'+title+'</i></span>');
         img.append(overlay);
         // add overlay events
         img.mouseenter( function() {
            var overlay = img.find('.gk-img-overlay');
            var realImg = img.find('img');
            overlay.css({
               'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
               'width': realImg.width() + "px"
            });
            overlay.attr('class', 'gk-img-overlay active');
         });

         img.mouseleave(function() {
            var overlay = img.find('.gk-img-overlay');
            overlay.attr('class', 'gk-img-overlay');
         });
      }
   });

(the code block exist in two places at the end of the .js file)

extensions.css - replace:
Code: Select all
.gk-portfolio .gk-images-wrapper > a > .gk-img-overlay > span:before {
   border: 2px solid #fff;
   -webkit-border-radius: 50%;
   -moz-border-radius: 50%;
   border-radius: 50%;
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   box-sizing: border-box;
   color: #fff;
   content: "\f0c1";
   font-family: FontAwesome;
   font-size: 22px;
   height: 52px;
   left: 50%;
   line-height: 50px;
   margin: -32px 0 0 -32px;
   opacity: 0; filter: alpha(opacity=0);
   position: absolute;
   text-align: center;
   top: 65%;
   -webkit-transition: all .2s ease-out;
   -moz-transition: all .3s ease-out;
   -ms-transition: all .3s ease-out;
   -o-transition: all .3s ease-out;
   transition: all .3s ease-out;
   width: 52px;
}

with:
Code: Select all
.gk-portfolio .gk-images-wrapper > a > .gk-img-overlay > span > i {
   color: #fff;
   font-size: 22px;
   height: 52px;
   line-height: 50px;
   margin: -32px 0 0 0;
   left: 0px;
   opacity: 0; filter: alpha(opacity=0);
   position: absolute;
   text-align: center;
   top: 65%;
   -webkit-transition: all .2s ease-out;
   -moz-transition: all .3s ease-out;
   -ms-transition: all .3s ease-out;
   -o-transition: all .3s ease-out;
   transition: all .3s ease-out;
   width: 100%;
}

and
Code: Select all
.gk-portfolio .gk-images-wrapper > a > .gk-img-overlay.active span:before {
   opacity: 1; filter: alpha(opacity=100);
   top: 50%;
}

with:
Code: Select all
.gk-portfolio .gk-images-wrapper > a > .gk-img-overlay.active i {
   opacity: 1; filter: alpha(opacity=100);
   top: 50%;
}


What it does - it puts links title in adidional <i> element inside of the span, removes fontawesome from :before the span, and replaces the :before with our i element giving it some styling.
User avatar
Moderator

GK User
Mon Aug 05, 2013 7:47 am
Thank you very much! Now it's fantastic ;)

Did you like how I changed the Image show CSS? :D

Again, thanks!

Stefano
http://movi-menti.it
User avatar
Fresh Boarder

GK User
Mon Aug 05, 2013 8:13 pm
Its nice to see work of people who knows a lot about css3 :) - nice effect indeed.
User avatar
Moderator

GK User
Thu Jan 16, 2014 4:11 pm
That doesn't work for me. And I Don't know why.
I changed the code like provided and now the portfolio is vanished.

www.obornik.de/wordpress
User avatar
Fresh Boarder

GK User
Fri Jan 17, 2014 8:41 am
Probably you did something wrong. I would suggest trying to restore oryginal files and use html/php enabled editor to edit the files. Perhaps sever error log will help to find the cause of the problem.
User avatar
Moderator

GK User
Fri Jan 17, 2014 1:43 pm
I tried it 10 times, with differentkinds of editors and iit just didn't work. Sorry.

Is it possiible that you fix that? I would pay for it, of course.
User avatar
Fresh Boarder

GK User
Fri Jan 17, 2014 9:57 pm
Please do 2 things:
1. Bring back the original files of the widget
2. PM me FTP access to your hosting server and login/password for wp user with admin privileges (create one for me).

If you will be able to do it today, I'll check it tomorrow.
User avatar
Moderator

GK User
Sun Jan 26, 2014 5:52 pm
Hi, did you get my PM?
User avatar
Fresh Boarder

GK User
Mon Jan 27, 2014 4:55 pm
Sorry, no please send it again.
User avatar
Moderator

GK User
Mon Jan 27, 2014 5:12 pm
OK, it says "SENT: MON JAN 27, 2014 4:02 PM" but it's still in the outbox.
I don't know if yo got it.
User avatar
Fresh Boarder

GK User
Wed Jan 29, 2014 7:54 pm
I did the change and it works fine. Please remember to backup the template files, because if you will update it someday, the changes will disappear.
User avatar
Moderator

GK User
Thu Jan 30, 2014 7:30 am
Tanks a lot!!!
User avatar
Fresh Boarder

GK User
Thu Feb 06, 2014 9:55 am
I was able to make the changes, but now the image shows nothing (no title or icon) when I hover. I don't think I did anything wrong, but nothing is being loaded within the <span> tags now.

Any help is appreciated!
User avatar
Fresh Boarder

GK User
Thu Feb 06, 2014 1:46 pm
The only thing that is possible is that you have made the changes wrong.
Could You please post an url to your site?
User avatar
Moderator

GK User
Thu Feb 06, 2014 2:53 pm
Cyberek wrote:The only thing that is possible is that you have made the changes wrong.
Could You please post an url to your site?


Sure http://wp.paulgiordano.com/#gk-header

I've attached the extensions.css and portfolio.js that I'm using.

Thanks for your help. :D
User avatar
Fresh Boarder

GK User
Fri Feb 07, 2014 2:33 pm
Any update on this?
User avatar
Fresh Boarder

GK User
Sat Feb 08, 2014 10:43 am
It seems you have found a bug in our template :).
Please provide an information how would you modify the background - what colour should it be, Ill provide correct override.css declaration to fix that.
Ill also inform you when the fix for template will be ready.
User avatar
Moderator

GK User
Sat Feb 08, 2014 12:34 pm
Cyberek wrote:It seems you have found a bug in our template :).
Please provide an information how would you modify the background - what colour should it be, Ill provide correct override.css declaration to fix that.
Ill also inform you when the fix for template will be ready.


Interesting, thanks for looking into that.

I'm going to leave the background hover color the default color II (#67b5ff).
User avatar
Fresh Boarder

GK User
Tue Feb 11, 2014 8:10 pm
Ok, that above responce should not go to this post :/
I have checked the js file and it seems to be working fine.
Could you post a link to a site, where those changes was made?
User avatar
Moderator

GK User
Tue Feb 11, 2014 8:12 pm
Cyberek wrote:Ok, that above responce should not go to this post :/
I have checked the js file and it seems to be working fine.
Could you post a link to a site, where those changes was made?


Sure http://wp.paulgiordano.com/#gk-header

I'm hoping to have this fixed ASAP, thanks :)
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 11:54 am
Now I see where the problem lies.
In your portfolio.js you will find same block of code added twice. You have modified it in first block of code, but scroll down few lines and same code will be there again - please correct it also there.
User avatar
Moderator

GK User
Wed Feb 12, 2014 12:45 pm
Cyberek wrote:Now I see where the problem lies.
In your portfolio.js you will find same block of code added twice. You have modified it in first block of code, but scroll down few lines and same code will be there again - please correct it also there.


I just tried this, and it did not fix anything. Here is the live code I see for the image when I hover. Notice that there is no title within the SPAN tags. It seems there's an issue calling the title in the JS.


<a href="http://wp.paulgiordano.com/?p=1016" title="TWC About Us Technology" class="gk-image animate_queue_element active loaded">
<img src="http://wp.paulgiordano.com/wp-content/themes/Creativity/gavern/cache_nsp/technology-widget_gk_portfolio-2.png" alt="TWC About Us Technology">
<div class="gk-img-overlay" style="margin-left: -167px; width: 334px;">
<span></span>
</div>
</a>


I had a similar issue with a lightbox plugin due to the latest version of Wordpress. I was forced to add code to the functions.php to allow the title of the image to show up.
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 2:47 pm
Please check this file:
http://wp.paulgiordano.com/wp-content/t ... ?ver=3.8.1
Scroll it to the bottom, and slowly up. Find this block:
Code: Select all
// add overlays
        widget.find('.gk-image').each(function (i, img) {
            img = jQuery(img);
            if (img.find('.gk-img-overlay').length === 0) {
                // create overlays
                var overlay = jQuery('<div class="gk-img-overlay"></div>');
                overlay.html('<span></span>');
                img.append(overlay);
                // add overlay events
                img.mouseenter(function () {
                    var overlay = img.find('.gk-img-overlay');
                    var realImg = img.find('img');
                    overlay.css({
                        'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
                        'width': realImg.width() + "px"
                    });
                    overlay.attr('class', 'gk-img-overlay active');
                });

                img.mouseleave(function () {
                    var overlay = img.find('.gk-img-overlay');
                    overlay.attr('class', 'gk-img-overlay');
                });
            }
        });

It is still not changed.
User avatar
Moderator

GK User
Wed Feb 12, 2014 2:51 pm
Cyberek wrote:Please check this file:
http://wp.paulgiordano.com/wp-content/t ... ?ver=3.8.1
Scroll it to the bottom, and slowly up. Find this block:
Code: Select all
// add overlays
        widget.find('.gk-image').each(function (i, img) {
            img = jQuery(img);
            if (img.find('.gk-img-overlay').length === 0) {
                // create overlays
                var overlay = jQuery('<div class="gk-img-overlay"></div>');
                overlay.html('<span></span>');
                img.append(overlay);
                // add overlay events
                img.mouseenter(function () {
                    var overlay = img.find('.gk-img-overlay');
                    var realImg = img.find('img');
                    overlay.css({
                        'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
                        'width': realImg.width() + "px"
                    });
                    overlay.attr('class', 'gk-img-overlay active');
                });

                img.mouseleave(function () {
                    var overlay = img.find('.gk-img-overlay');
                    overlay.attr('class', 'gk-img-overlay');
                });
            }
        });

It is still not changed.


Sorry, didn't save the change before....

Made the change now, and nothing shows up for the portfolio at all :(
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 2:56 pm
Showing the following errors:

Uncaught ReferenceError: title is not defined - portfolio.js?ver=3.8.1:127
(anonymous function) - portfolio.js?ver=3.8.1:127
gkPortfolioInit - portfolio.js?ver=3.8.1:125
(anonymous function) - portfolio.js?ver=3.8.1:10
(anonymous function) - portfolio.js?ver=3.8.1:5
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 3:10 pm
In both places please replace:
Code: Select all
title = img.attr('title');

with:
Code: Select all
title = jQuery(img).attr('title');
User avatar
Moderator

GK User
Wed Feb 12, 2014 3:12 pm
Cyberek wrote:In both places please replace:
Code: Select all
title = img.attr('title');

with:
Code: Select all
title = jQuery(img).attr('title');


Unfortunately, this didn't fix the issue either :(

However, when I click the More Work button, it reveals the images, but the hover does not work.
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 3:15 pm
Code: Select all
var img = jQuery(img);
var title = jQuery(img).attr('title');

and this way?
User avatar
Moderator

GK User
Wed Feb 12, 2014 3:17 pm
Cyberek wrote:
Code: Select all
var img = jQuery(img);
var title = jQuery(img).attr('title');

and this way?


FIXED! :D

Thanks, that seemed to work.
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 3:18 pm
Ok, Ill update info in thread.
User avatar
Moderator

GK User
Wed Feb 12, 2014 3:27 pm
Cyberek wrote:Ok, Ill update info in thread.


Great,

One more question. The "Data source settings" in the widget settings, is there a way to make the images load in random order that changes each refresh?
User avatar
Fresh Boarder

GK User
Wed Feb 12, 2014 6:35 pm
No, there is no such functionality right now.
User avatar
Moderator

GK User
Wed Nov 25, 2015 5:36 pm
Hi Cyberek!

I allready made the changes in the 2 files...
But I have a question, I have to add and additional format in the title of the images or in the post?? or how it works?

Thanks
User avatar
Gold Boarder

GK User
Fri Nov 27, 2015 4:48 pm
You need to add a tittle to an image (via media editor for example). But this is quite old solution and I'm not sure if it will work with updated wp.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.