This topic has 3 replies, 2 voices, and was last updated 10 years by sandervm86.
-
Author
-
November 24, 2014 at 12:52 #36450sandervm86Participant
The plugin Nelio External Featured Image uses external images, this works when i do exact what he says under here. but everythime you come with a update i need to upload his files into it. is is possible to write a code that i can put in child? so i don`t have to do this every time? (a overrule) i added the files to the post, so you can see what he changed (explained it under here to) Tnx in advange.
So I understand you only have this problem in the landing page, right? After looking at the Kleo’s source files, I realized that the theme defines a function called kleo_get_post_thumbnail_url (file kleo-framework/lib/function-core.php lines 642-665). The function is used several times in the code (in particular, every time the theme is about to print a featured image).
The function is used in the following files:
lib/widgets/recent_posts.php line 62
page-parts/post-content-masonry.php line 114
page-parts/portfolio-masonry.php line 110
page-parts/post-content-carousel.php line 109
single-portfolio.php line 119In order to fix the issue, you just need to modify them all. How does the theme work? Well, when that function is used, an img tag is about to be printed in the final HTML document. Printing the img tag directly (as the theme does) and using the function prevents our plugin from triggering.
Therefore, we need to check whether the “current” post (whose id is accessible using a function called get_the_ID) uses an external featured image before that img tag is printed. If it does, print that image using WordPress’ standard method (get_)the_post_thumbnail. If it doesn’t use an external featured image, then we can let the theme do its own work.
November 25, 2014 at 23:13 #36591sharmstrModeratorYou can put all of those files in your child theme. Just make sure you use the same directory structure that Kleo has
/kleo-child/lib/widgets/recent_posts.php line 62
/kleo-child/page-parts/post-content-masonry.php line 114
/kleo-child/page-parts/portfolio-masonry.php line 110
/kleo-child/page-parts/post-content-carousel.php line 109
/kleo-child/single-portfolio.php line 119Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.