• Resolved justhodl

    (@justhodl)


    Seems the website has been under maintenance for a good while (the chat-bot is not the most helpful tool either), and I cannot find any other info that remotely seems like a “contact info” to reach the team.

    I checked some screenshots of your plug-in. Do you allow targeted insertions of code onto a specific page? I only see “Run everywhere”, “only in Admin area”, “Run once”.

    Or, similar to Woody Snippets, do you allow code injections using a short code?

    I was referred to your plug-in by a few developers I liaise with, and I’m happy to give Code Snippets a try!

    • This topic was modified 3 years, 10 months ago by justhodl.
Viewing 3 replies - 1 through 3 (of 3 total)
  • try something like this:

    add_action( 'wp_head', function () {
    	if ( ! is_page( [ your pages ids separated by comma ] )) {
    		return;
    	} ?>
    
    your content
    
    <?php } );
    Plugin Author Shea Bunge

    (@bungeshea)

    Yep, as @mathrim87 suggested, using is_page() in your snippet as the example showed is a great way of limiting a snippet to specific pages.

    Thread Starter justhodl

    (@justhodl)

    Thank you – will bear this in mind the next time I use the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Injecting code on a specific page’ is closed to new replies.