Wordpress Pages question

by greggy
14 replies
Hi warriors,
I am tring to insert a code on wordpress pages (different code/script in different pages) but I can't seem to figure out how to do that. Could you please assist me on how to enter a code between <body>...</body> tags?

Greg
#pages #question #wordpress
  • Profile picture of the author Brenden Clerget
    Wordpress works off of a template system, so you'd need to find the header or part of the template that loads that part of the page. They're different depending on the template.
    {{ DiscussionBoard.errors[2645006].message }}
  • Profile picture of the author LynnM
    As Joe says above, you should be able to put the code into each page individually (Dashboard/Pages), under the html tag.
    {{ DiscussionBoard.errors[2645058].message }}
    • Profile picture of the author thecableguy
      You have to be in the HTML screen (not Visual)

      Is it a php script? With the older versions of WP I had to install a plugin
      WordPress › Exec-PHP WordPress Plugins
      {{ DiscussionBoard.errors[2645627].message }}
      • Profile picture of the author Sandra Martinez
        I´m not sure about all the templates... but some templates allow you to choose a different setup (in particular different set of widgets) for different pages (tied up with menu items).

        so you can add the code as widgets and have it displayed for different sets.

        Also some positions display as if it were content... more or less, and you can get away with it.

        Sandra
        {{ DiscussionBoard.errors[2645765].message }}
  • Profile picture of the author tecHead
    Originally Posted by greggy View Post

    Hi warriors,
    I am tring to insert a code on wordpress pages (different code/script in different pages) but I can't seem to figure out how to do that. Could you please assist me on how to enter a code between <body>...</body> tags?

    Greg
    The opening <body> tag is found in header.php

    The closing </body> tag is found in footer.php

    To place something between the <body> and </body> tags; you'll more than likely need to add your code to the footer.php file ABOVE the </body> tag found within.

    HTH
    PLP,
    tecHead
    Signature
    Learn Everything You Need to Know About CryptoCurrencies
    Automation is the primary conduit to successful relaxation
    {{ DiscussionBoard.errors[2645830].message }}
    • Profile picture of the author Sandra Martinez
      Originally Posted by tecHead View Post

      The opening <body> tag is found in header.php

      The closing </body> tag is found in footer.php

      To place something between the <body> and </body> tags; you'll more than likely need to add your code to the footer.php file ABOVE the </body> tag found within.

      HTH
      PLP,
      tecHead
      can I ask a question about this? how will this work to have different code in different pages? you build that in the php added?
      {{ DiscussionBoard.errors[2645869].message }}
      • Profile picture of the author tecHead
        Originally Posted by Sandra Martinez View Post

        can I ask a question about this? how will this work to have different code in different pages? you build that in the php added?
        Hi Sandra

        The simple answer would be 'yes'; as you probably already know, (based on the fact that you asked this question), that WP works off of 'templates'. So, any code inserted in the template (where ever put) will be 'static' to that template... unless the code recognizes the differences between post type.

        I haven't found a need to get that deep into it, but I'm thinking this might be one way of using the new WP post types.

        There's also another way of utilizing WP to accomplish this... and that's through their template system. Deep explanation would be outside the scope of this thread, but you can basically have any design/layout/content you want incorporating the WP database into said template.

        HTH
        PLP,
        tecHead
        Signature
        Learn Everything You Need to Know About CryptoCurrencies
        Automation is the primary conduit to successful relaxation
        {{ DiscussionBoard.errors[2646101].message }}
        • Profile picture of the author Sandra Martinez
          Originally Posted by tecHead View Post

          Hi Sandra

          The simple answer would be 'yes'; as you probably already know, (based on the fact that you asked this question), that WP works off of 'templates'. So, any code inserted in the template (where ever put) will be 'static' to that template... unless the code recognizes the differences between post type.

          I haven't found a need to get that deep into it, but I'm thinking this might be one way of using the new WP post types.

          There's also another way of utilizing WP to accomplish this... and that's through their template system. Deep explanation would be outside the scope of this thread, but you can basically have any design/layout/content you want incorporating the WP database into said template.

          HTH
          PLP,
          tecHead
          ok... so adding php code to the header doesn´t solve his problem, is it?

          never mind... you are having a hard day today... lets leave it.

          Sandra
          {{ DiscussionBoard.errors[2647551].message }}
          • Profile picture of the author tecHead
            Originally Posted by Sandra Martinez View Post

            ok... so adding php code to the header doesn´t solve his problem, is it?

            never mind... you are having a hard day today... lets leave it.

            Sandra
            lol, no worries.. I'm good.. but, ok
            Signature
            Learn Everything You Need to Know About CryptoCurrencies
            Automation is the primary conduit to successful relaxation
            {{ DiscussionBoard.errors[2647581].message }}
            • Profile picture of the author greggy
              Not sure if my initial question was answered but I get some sense from what has already been posted. I have spokesperson videos for a wordpress website and I need to add these pieces of code to different pages so as to guide the visitors. I hope saying this will make it easier for you to help me.
              GREG
              {{ DiscussionBoard.errors[2647707].message }}
              • Profile picture of the author rosetrees
                Exactly what most have said. Add the code for each video, via the html tab, onto the page(s) where you want each one displayed.
                {{ DiscussionBoard.errors[2648330].message }}
                • Profile picture of the author Sandra Martinez
                  Originally Posted by rosetrees View Post

                  Exactly what most have said. Add the code for each video, via the html tab, onto the page(s) where you want each one displayed.
                  is it that simple? doesn´t the html side eat the code? have to try this...

                  thanks!!

                  well, Greg... if this works you don´t need anything else...

                  Sandra
                  {{ DiscussionBoard.errors[2648343].message }}
              • Profile picture of the author Sandra Martinez
                Originally Posted by greggy View Post

                Not sure if my initial question was answered but I get some sense from what has already been posted. I have spokesperson videos for a wordpress website and I need to add these pieces of code to different pages so as to guide the visitors. I hope saying this will make it easier for you to help me.
                GREG
                I setup a test site for a new template. it has the capability to create different setups for different menu items (i.e. different pages), if you combine it with a php widget, this one for example:

                WordPress › PHP Code Widget WordPress Plugins

                you are ready to go...

                the template is not free, but the guys deliver big time...

                I have been working with them for years, have a developers membership for joomla... just getting the thumb wet in in their wp themes right now...

                pm me and i let you play with it and see if it is what you want.

                Sandra
                {{ DiscussionBoard.errors[2648339].message }}

Trending Topics