Site logo

Archived topic

Adding custom PHP through a Hook

5 replies · Started by Sal C on June 30, 2021

Viewing posts 1–6 of 6

Hi,

I have noticed that under Hook > Settings there are 2 checkboxes - "Execute PHP" and "Execute shortcodes".

I want to add a custom PHP code to my pages, which enables me to add a custom shortcode. Therefore, these 2 checkboxes seemed to perfectly fit my use case. However, I have been unable to successfully load my PHP through a Hook - even with these 2 checkboxes enabled. Instead, I was able to make it work through a child theme.

Could you clarify what the purpose of these 2 checkboxes is? Also, is there a way to actually execute PHP with a Hook element. It would be very useful to me because I would like the custom PHP to loaded only on select pages.

I look forward to your reply.

Best regards,

Sal

Hi,

I can't share it right now. It calls on an external API in order to update a shortcode.

I did use the child theme methos outlined in that article, and it worked as expected. Would it be possible to only load the PHP code I added to the child theme only on a specific page?

Thanks,

Sal

Thanks, I appreciate it.

Best regards,

Sal

No problem :)

This archived topic is closed to new replies.