- This topic has 5 replies, 2 voices, and was last updated 6 months, 3 weeks ago by Leo.
March 28, 2020 at 8:14 am #1213127Edera di V.D.
I am new about wordpress and about generalpress, I installed it a couple of days ago.
I have two questions that I couldn’t find solution in the forum.
(1) this morning I create a hook that showed a button, with this code
$custom_field = get_post_meta( get_the_ID(), ‘mycustomfield’, true );
I set the display rules on all articles and it was ok.
Now I excluded some articles from the display rule and it doesn’t show anymore on no article.
(2) I tried to create a shortcut with Elements > Hook > custom hook
But I can’t understand how to show it in my posts or pages.
I continue to show the text of the shortcode without executing it.
Thanks a lotMarch 28, 2020 at 9:50 am #1213224LeoStaffCustomer Support
Can you do this first so I can inspect the code better and eliminate any caching errors?
1. Sounds like a display rules error. Can you show a screenshot of the display rules?
You can use a service like this to upload a screenshot:
2. Did you check to Execute shortcode?
https://docs.generatepress.com/article/hooks-element-overview/#settingsMarch 28, 2020 at 11:04 am #1213282Edera di V.D.March 28, 2020 at 2:44 pm #1213461LeoStaffCustomer Support
1. So just to make sure, everything shows correctly if you don’t add any exclusions in display rules?
2. If you are using shortcode in the hooks element then execute shortcode needs to be checked.
If that doesn’t work, can you test if the shortcode executes in regular page content?March 29, 2020 at 1:54 am #1218154Edera di V.D.
Before answer I tried again, I duplicated the hook and set the display rule: All articles without exclusion, and it worked.
but when I saved it worked well, despite this message, and after I saved the error disappeared.March 29, 2020 at 9:46 am #1218664
- You must be logged in to reply to this topic.