Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author cleoni

    (@cleoni)

    Actually you cannot do it with CSS.

    A quick fix would be to edit the file lightbox.php, lines 144-148 from this:

    $gall .= '
    		,
    		"titleFormat"		: function(title, currentArray, currentIndex, currentOpts) {
    			return "<span id=\'fancybox-title-over\'><span id=\'fancybox-title-pretext\'>'.__('Image','simplest-gallery').' </span>"+(currentIndex+1)+" / " + currentArray.length + (title.length ? " &nbsp; " + title : "") + "</span>";
    		}';

    to this:

    		$gall .= '
    		,
    		"titleFormat"		: function(title, currentArray, currentIndex, currentOpts) {
    			return "<span id=\'fancybox-title-over\'><span id=\'fancybox-title-pretext\'>'.__('Image','simplest-gallery').' "+(currentIndex+1)+" / " + currentArray.length + (title.length ? " &nbsp; </span>" + title : "") + "</span>";
    		}';

    (the first </span> tag has been moved a bit further in the line).
    It might be interesting to integrate this in the next release and removing the useless “Image” hidden text.

    The above fix is untested, but it should work. Let me know if it worked for you.

    Plugin Author cleoni

    (@cleoni)

    Assuming issue is fixed, I close this ticket.

    If more help is needed, just open a new one.

    Thread Starter jenpen25

    (@jenpen25)

    cleoni, please remind me how to access lightbox.php.

    Plugin Author cleoni

    (@cleoni)

    The safest way is to access your site’s files via FTP and you will find it into wp-content/plugins/simplest-gallery

    There is also an editor in the backend (menu Plugin->Plugin editor, then select Simplest Gallery and that file).

    Anyway please be advised that this requires a minimum of programming skills. With PHP files it is sufficient to put a character in the wrong position and your site might stop working (if it happens, use FTP to delete the plugin folder, then reinstall and redo).

    Cheers

    Thread Starter jenpen25

    (@jenpen25)

    Thanks cleoni. You can close this now.

    Thread Starter jenpen25

    (@jenpen25)

    cleoni thanks but this didn’t work. It didn’t remove the ‘Image x/x’ from the captions.

    Plugin Author cleoni

    (@cleoni)

    I see. Let me check it on my own site.
    I think this fix would be beneficial to all for the next release.
    This image numbering is something which I would get gladly rid of.

    Thread Starter jenpen25

    (@jenpen25)

    Much appreciated.

    Plugin Author cleoni

    (@cleoni)

    Hello, I have made a change in order to remove image number where a title has been set for the image (it will however show “Image N / NN” if no title has been set).

    The change will be incorporated in the next release but since I don’t know when it will happen, and since it’s possible that in your website the code of lightbox has been twekaed already, I recommend you apply this fix simply by changing the lines 147-149 from:

    		"titleFormat"		: function(title, currentArray, currentIndex, currentOpts) {
    			return "<span id=\'fancybox-title-over\'><span id=\'fancybox-title-pretext\'>'.__('Image','simplest-gallery').' </span>"+(currentIndex+1)+" / " + currentArray.length + (title.length ? " &nbsp; " + title : "") + "</span>";
    		}';

    to this:

    		"titleFormat"		: function(title, currentArray, currentIndex, currentOpts) {
    			return "<span id=\'fancybox-title-over\'><span id=\'fancybox-title-pretext\'>" + (title.length ? title : ("'.__('Image','simplest-gallery').'" +(currentIndex+1)+" / "+currentArray.length) ) + "</span></span>";
    		}';

    Apply this fix on the file lightbox.php.
    Save and then test.

    If it works, and you don’t wont the “Image #” to appear at all in any case, even when there is no title for the image, you can further replace this part

    + (title.length ? title : ("'.__('Image','simplest-gallery').'" +(currentIndex+1)+" / "+currentArray.length) ) +

    with this

    + title +

    You can see the fix in action at this page: https://vic20reloaded.com/vic-20-cartridge-games-collection-1a/
    as you can see “Image N / NN” before the title does not appear.

    Hope it helps!

    Thread Starter jenpen25

    (@jenpen25)

    Yes! Thanks, that’s exactly what I needed. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove image number’ is closed to new replies.