- This topic has 30 replies, 2 voices, and was last updated 6 years ago by
Leo.
-
AuthorPosts
-
March 30, 2020 at 9:50 am #1219809
itg
Hi Guys
My home page is a list of my latest posts.
I am using a hook and it is displaying on all post snippets on home page. I am using the following code above the hook html in the hook box and enabling php but hooks are still showing on all archive pages and home page.
Any ideas how i stop the hook showing, i only want the hooks to display on the actual page or post, thank you
The exact code i am using in the hook box above the hook html
<?php if ( ! is_front_page() && ! is_home() ) : ?>
This content is EXCLUDED from the latest post page
<?php endif; ?>March 30, 2020 at 11:22 am #1219917Leo
StaffCustomer SupportHi there,
Have you tried the hooks element module?
https://docs.generatepress.com/article/hooks-element-overview/You can use the Display rules tab so no need to write your own conditional rules:
https://docs.generatepress.com/article/hooks-element-overview/#display-rulesLet me know if this helps 🙂
March 30, 2020 at 11:45 am #1219942itg
Hi Leo, im am not really good at this stuff, i read it but never understood it.
I thought i could simply put a bit of code into the hook box but its not working.
Could i use css or does it have to be the php hook code. Tell you truth i am lost any help you can give would be appreciated, thank you
March 30, 2020 at 11:46 am #1219943itg
did you look at my home page leo?
March 30, 2020 at 11:55 am #1219951Leo
StaffCustomer SupportYup I did look at your home page.
Are you referring to the Chinese Antique Valuations And Appraisals section?
So you only want that to appear on the home page?
March 30, 2020 at 11:57 am #1219956itg
The valuation section is repeated on every post on the home page, i wish it to only show on the actual post or page and not to show on the home page or archive pages, thanks
March 30, 2020 at 12:01 pm #1219959itg
i thought this code placed in the hook box would have stopped the hook being shown on home page and archive pages
<?php if ( ! is_front_page() && ! is_home() ) : ?>
This content is EXCLUDED from the latest post page
<?php endif; ?>March 30, 2020 at 12:04 pm #1219962Leo
StaffCustomer SupportSo try creating a new hook element by going to Appearance > Elements and click “Add New”, from the Element dropdown list, choose “Hook”.
Add your content in the hook element content box (green box) and select the desired hook (red box)
https://www.screencast.com/t/RWJfh1q0OThen this would be your display rules:
https://www.screencast.com/t/xj41D4d8Let me know if this helps 🙂
March 30, 2020 at 12:05 pm #1219964Leo
StaffCustomer SupportYou don’t need the conditional statement in the hook box.
Simply add this as the content:
<blockquote><strong>Chinese Antique Valuations And Appraisals</strong> <br> <br> <em>Do you own a piece of Chinese porcelain or an oriental work of art that you would like to know more about, such as age, history and value? <br> <br> Then you should really consider using our <a href="https://www.chineseantiques.co.uk/valuations-authentication-appraisals/"><strong>Chinese Antique Valuation Service</strong></a> as the last thing you want to do is risk under selling the piece due to lack of knowledge or ill gotten advice.</em></blockquote>March 30, 2020 at 12:17 pm #1219973itg
Hi Leo i do not have any element option, if i go to appearance there is no elements section?
March 30, 2020 at 12:29 pm #1219982Leo
StaffCustomer SupportMake sure Element is activated:
https://docs.generatepress.com/article/installing-gp-premium/#activate-your-modulesMarch 30, 2020 at 12:31 pm #1219984itg
Hi Leo, it is activated… thanks
no options to navigate to where ever it is
March 30, 2020 at 12:34 pm #1219987Leo
StaffCustomer SupportJust to confirm, the Elements module is activated but you don’t see Elements in Dashboard > Appearance?
If so can you send me the dashboard access preferably with all plugins disabled except GP Premium?
You can send the dashboard access using Account Issue here:
https://generatepress.com/contact/Please include the following information:
– The URL of this topic.
– Login URL.
– Username and password.March 30, 2020 at 12:36 pm #1219993itg
ok all sent thanks
March 30, 2020 at 12:38 pm #1219995Leo
StaffCustomer SupportYou are using a very old version of GP Premium:
https://www.screencast.com/t/YHjT0j0EYThe current version is 1.9.1 so please update then activate the Elements module:
https://docs.generatepress.com/article/updating-gp-premium/ -
AuthorPosts
- You must be logged in to reply to this topic.