You can use the wordpress Conditional Tags
You can add something like this to your functions.php file:
is_single( 'your-post-slug' )
add_action( 'wp_head', 'your_function_with_pixel' )
There are a number of different conditional tags you can use. And your-post-slug can be substituted with the post id as well.
Related Posts:
- Add a script as a dependency to a registered script
- Setting up an API “listening” page
- Serving wp-includes (front-end) javascript from a different domain?
- How can I selectively print scripts to the footer of certain admin pages?
- WP CLI theme install. Install a private repo?
- change $src from wp_register_script in plugins/themes
- By having WordPress in a subfolder does it mean more script executions?
- Script Code in Text Widget Does NOT Show
- Invision + WordPress integration
- wp_print_scripts runs twice
- How to serve wp-includes javascripts from CDN? [duplicate]
- Register scripts located in child theme?
- How to add GET variable after script url?
- Generating a static page from a script
- Refused to execute as script because “X-Content-Type: nosniff” was given and its Content-Type is not a script MIME type
- Disable load scripts and styles not working
- Socialite not displaying icons [closed]
- Script dependencies generates different outputs
- Renaming the ‘build’ directory generated by @wordpress/scripts for React development
- What is your best practice to execute one-time scripts?
- How can I get a list of all enqueued scripts and styles?
- How to properly dequeue scripts and styles in child theme?
- How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?
- Load plugin scripts and styles only on plugin page
- Editing Source Code in WordPress
- How to load JQuery easing script in wordpress?
- Odd Script File Trying to be Loaded
- Listing registered scripts
- Including javascript for a shortcode
- Trigger a php file on every post or page if a condition is met
- How do I load custom scripts and styles for a page?
- Styles and Scripts, Selectively enqueue across entire site
- How to remove some external js files from source?
- Best way to create a user programatically
- Why Allow Script Commands in Comments?
- WordPress Script Loading/Unloading — wp_deregister_script(‘jquery’)
- Is there any free (or cheap) software that can be used for testing WordPress functionality?
- How can I add my script to admin using script-loader.php?
- Disable unneeded scripts in a wordpress installation
- How to properly add Bootstrap and JQuery Javascripts?
- Question about the way that wp_register_script works
- How do I enqueue a JavaScript in my footer via the functions.php file?
- Retrieve URL of Script/Style and Dependencies
- Overwrite or Replace code in WP_Footer
- Add stylesheets and js to template files when shortcode is used
- Change directory of javascript files
- Correct check for any admin page with editor
- Is there a way to list all the JavaScript scripts that are actually loaded by WordPress? Do we care?
- List All Enqueued Scripts and Styles
- Repeating admin-ajax.php not found error in admin
- Styles and scripts inside template part
- Custom tag being removed from text editor
- I can’t enqueue my scripts – They literally aren’t being added to my site
- How to load library scripts in admin from plugins in noConflict wrapper?
- Add script into front from my plugin
- wp_enqueue_script was called incorrectly Issue when active plugins of WordPress Admin Bar Improved
- Display a consistent Google Plus icon on ALL pages of my site
- Can inactive WordPress plugins still load scripts?
- Using jquery with wordpress using wp_enqueue_scripts
- Javascript asset not enqueuing with the rest
- How to use custom Javascript code inside a plugin?
- Load scripts for do_shortcode( ‘ [ my_shortcode ] ‘ )
- Order of WP page load (including widgets, php, plugins, media, templates, and CSS) [duplicate]
- Setting Variable Path to Template Directory inside Script
- WordPress Stats Plugin: Display Post Views [closed]
- What’s the default setting for including a in a post
- Compile a blocks src directory and main index.js entry file and output to different build dirs?
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- How to force one script to load before google tag manager script
- Preventing a missing or faulty plugin loaded inside of wp-settings from halting a script
- Media Library Cleanup A Thought Exercise
- How to add the google ad conversion tracking code into the thank you page
- How do you enable scripts on a WordPress installation in Softaculous?
- How to add a PHP scripts into WordPress
- How to use script in WordPress installation?
- Prevent malicious scripts to be submitted in post
- Enabling plugin on specific pages and subpages
- Add Custom Taxonomy into Script
- style.min.css code issue
- How to get, in WP page’s script, a wp enqueued script (in Functions.php)?
- How to change text in a page by utilizing a custom user id?
- Editing existing pre-created menus in PHP
- Domain mapping breaks some plugin scripts and css
- Run one-time script calling plugin functions
- WordPress menus – automatically generate
- Echo outside HTML
- Plugin’s required JS not being inserted in my theme
- Manipulate database of WordPress site with my own scripts
- How to deregister scripts all at once
- How do I display the handle for all front-end enqueued scripts in plugin options page?
- Make different sites on multisite reference same script
- Ajax navigation and scripts loaded only on certain pages
- Javascript block in Twenty Twelve theme
- Adding css and js to a blank page created with custom template
- Enqueue Script in custom plugin before other
- jQuery functions work in console, but not live
- Change color of a specific word generated by script [closed]
- kali php problem [closed]
- Scripts don’t enqueue after removing plugin
- How to defer block.json scripts?