Add info to the head of a specific post
-
I need to add some link information and a short script to my <head> on a specific post (post 9597). I am adding the following code to my themes functions.php
function chromeextension_head() { if(is_single( '9597' )) ?> <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/pknhdfeakbecfgahlbdfnjfjgbkgllfo"> <script> function ExtInstall() { if (chrome.app.isInstalled) alert("already installed!"); else chrome.webstore.install(); } </script> <?php } add_action( 'wp_head', 'chromeextension_head' );
The problem is that now the code shows up on all posts and pages, not just post 9597. What am I doing wrong?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add info to the head of a specific post’ is closed to new replies.