How to set og:image only for Home page?
Rate this topic:
- GK User
- Fri Mar 24, 2017 9:10 pm
- Reply with quote
- Report this post
Hi,
on this page ( http://mnt.mk/ ) the og:image is always the first image from the slider. How can I put static, fixed image for the homepage only?
Thanks,
Gorast
on this page ( http://mnt.mk/ ) the og:image is always the first image from the slider. How can I put static, fixed image for the homepage only?
Thanks,
Gorast
-
- Platinum Boarder
- teitbite
- Wed Mar 29, 2017 9:21 am
- Reply with quote
- Report this post
Hi
Easiest will be to add this code to /layout/blocks/head.php
Easiest will be to add this code to /layout/blocks/head.php
- Code: Select all
<?php
if( JRequest::getVar('Itemid') == ID_OF_YOUR_HOMEPAGE ):
print '<meta property="og:image" content="URL_TO_STATIC_IMAGE" />';
endif;
?>
-
- Moderator
- GK User
- Sun Jun 04, 2017 12:25 pm
- Reply with quote
- Report this post
Worked like charm.
I added || and the rest of the menu items just to cover it.
This makes me thinking of trying to make plugin so admins can upload custom images for menus
Thanks,
Gorast
I added || and the rest of the menu items just to cover it.
This makes me thinking of trying to make plugin so admins can upload custom images for menus
Thanks,
Gorast
-
- Platinum Boarder
- teitbite
- Wed Jun 07, 2017 8:05 am
- Reply with quote
- Report this post
Hi
This is not a bad idea Such question was asked couple of times already, so it sure be useful to some people.
This is not a bad idea Such question was asked couple of times already, so it sure be useful to some people.
-
- Moderator
4 posts
• Page 1 of 1