Support ForumMaking blog images open in Lightbox effect – Support Forum https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/feed/ Sun, 05 May 2024 15:23:42 +0200 http://bbpress.org/?v=2.5.12-6148 en-US https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-670 <![CDATA[Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-670 Mon, 16 Sep 2013 18:23:19 +0000 Michael Hi Ishyoboy.

Can you tell me if it is possible to hard-code into your theme, the facility to make images in blog posts, to open with the Lightbox effect like the portfolio. Or aletnatively using custom CSS perhaps which might be easier?

If so, which file(s) would I need to edit to make this happen?

Best wishes.
Michael.

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-680 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-680 Tue, 17 Sep 2013 06:28:16 +0000 IshYoBoy Hi Michael,

This can be managed easily in a Child Theme by adding the following code into its “functions.php”. See the Gist below:

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-687 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-687 Tue, 17 Sep 2013 09:33:06 +0000 Michael Thanks IshYoBoy, great fix.

Any chance you can tell me how to create a child theme?

I have had a go, but obviously it is beyond me because nothing worked. Any advice would be most welcome.

Regards.
Michael.

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-689 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-689 Tue, 17 Sep 2013 11:46:45 +0000 IshYoBoy Hi Michael,

We couldn’t have written it better:
https://codex.wordpress.org/Child_Themes

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-699 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-699 Wed, 18 Sep 2013 05:59:35 +0000 Michael Brilliant, I’ll have a go today.
Thank you so much for the excellent support.

Regards.
Michael.

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-702 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-702 Wed, 18 Sep 2013 06:16:49 +0000 IshYoBoy You’ll have it ready in 30 minutes max. It’s very easy :)

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-703 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-703 Wed, 18 Sep 2013 08:23:24 +0000 Michael Sorry IshYoBoy.

I created the 2 files style.css and functions.php as per the Codex. I placed your code in the functions.php file and activated the child theme, but everything broke.

It also said I was missing a template file!

So…
I have copied the php code into your functions.php file and everything works as wanted. Guess I’ll just stick to a main theme!

Regards.
Michael.

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-706 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-706 Wed, 18 Sep 2013 13:15:07 +0000 IshYoBoy Hmm.. very strange.. Did you do the following?

1. Add the “Template: creolio” comment in style.css?
2. Import the parent style? “@import url(‘../creolio/style.css’);” in style.css?

Updating the parent functions.php is also a way. Just be careful whenever there’s a future update available. You will have to re-do the change after the update.

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-707 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-707 Wed, 18 Sep 2013 14:42:21 +0000 Michael Hi IshYoBoy.

Here is the code I used.

functions.php file:


<?php

/*
* This code will add "lightbox" effect to any blog image wrapped within a link to another image.
*
*
*/

if ( ! function_exists( 'ishyoboy_activate_fancybox_on_blog_single' ) ) {
function ishyoboy_activate_fancybox_on_blog_single() {

if ( is_singular() && !is_singular( 'product' ) ){
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var thumbnails = jQuery("a:has(img)").not(".nolightbox").filter( function() { return /\.(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr('href')) });

if ( thumbnails.length > 0){
thumbnails.addClass( 'openfancybox-image' ).attr( 'rel', 'fancybox-post-image-<?php the_ID() ?>');
}
});
</script>
<?php
}

}
}
add_action( 'wp_head', 'ishyoboy_activate_fancybox_on_blog_single' );

?>

style.css file:


/*
Theme Name: Creolio Child
Description: Creolio Child Theme
Author: Michael Muscroft
Author URI: https://michaelmuscroft.com
Template: creolio
Version: 1.0.0
*/

/* =Imports styles from the parent theme
-------------------------------------------------------------- */
@import url('../creolio/style.css');

/* =Theme customization starts here
-------------------------------------------------------------- */

Hope this helps.
If need be I can re-activate the child theme for you to see the problem.

Regards.
Michael.

]]>
https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-710 <![CDATA[Reply To: Making blog images open in Lightbox effect]]> https://support.ishyoboy.com/forums/topic/making-blog-images-open-in-lightbox-effect/#post-710 Thu, 19 Sep 2013 07:05:14 +0000 IshYoBoy Hmm..
And what is the name of the folder the child theme is located in?

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>