Wordpress Plugin for Custom Header and Footer

by 18 replies
22
I have been looking for 2 days to find a plugin that can do the following, I figured it was a simple concept but apparently no one has thought of this. Unless I am wrong and didn't search hard enough.

I basically need to add custom html/js code either in the header section or footer section of a page post or blog posts within wordpress. I DO NOT need the code to be universal across the entire site or specifically for pages or posts. I need the code to be inserted in several individual posts/pages.

Is there a plugin to do so? I tried creating a custom fields but it took too much time
#main internet marketing discussion forum #custom #footer #header #plugin #wordpress
  • If you don't want the JS to placed in the entire site you use the HTML text editor. It's a bit sneaky but it works.

    For example, you are making a new page in your wordpress. Place the JS file anywhere you want in the text editot (HTML MODE). and then paste then link. things would work fine for you.
    • [1] reply
    • thanks but I have additional code as well that needs to be added not just the JS and they need to be in the header as well.
      • [1] reply
  • its callin some css and its also a link type html tag
  • You can try to create Child themes if you want. Do some google search and you will some useful tutorials and articles on that
  • i think this can be edited manually buut thanks too! D
  • in my humbble oppinion!
  • thanks everyone... but I want it to be very simple... cause sometimes I have trackers for my affiliate lps that i need to add but I dont need them on every page... can't believe there isnt a plugin for this
    • [1] reply
    • If you know what you are doing you could sort all of your posts that you need to do this under a specific category/tag and all of your pages as a child of a certain page. Then add an If statement to your themes functions.php that checks if the criteria are met and if so serves the code to the wp_head/wp_footer.
  • I saw mention of a plugin for it, but not where to find it.

    Editing the header.php seems like the best solution to me though.
    • [1] reply
    • but how can I target a specific post or page? that is my problem. I want to target an individual post or page
      • [1] reply
  • You think it's a "simple concept"... because you don't understand how WP and its theme system work:

    The header.php and the footer.php file is always the same no matter what kind of Page or post is displayed. And I even have to contradict Jill: your custom Page templates will also call for the same header and footer - unless you customize them further; i.e. adding custom header and/or footer to all of them.
    • [1] reply
    • a very good answer, as well as in other open source editing
  • I was looking for this too, thanks
  • Another idea that might work for what you want is to use a plugin that allows you to execute php code from within WordPress.
    you could then echo the php on any post of your choosing without having it on every page.
    Just thinking outside the box to help you find a solution.

    Regards,
    Jim Waller

Next Topics on Trending Feed

  • 22

    I have been looking for 2 days to find a plugin that can do the following, I figured it was a simple concept but apparently no one has thought of this. Unless I am wrong and didn't search hard enough. I basically need to add custom html/js code either in the header section or footer section of a page post or blog posts within wordpress. I DO NOT need the code to be universal across the entire site or specifically for pages or posts. I need the code to be inserted in several individual posts/pages.