Inserting Text/Content In Index.php (Wordpress)

by Dele
5 replies
Hi Warriors,

Happy New Year!

I previously had my own inserted content right within Main Index Template (index.php) of my Wordpress blog but i removed same sometime ago. I now want to re-insert some text but cannot recollect exactly where within the index.php code i should do that.

Btw i am quite aware of the necessity for only amending/updating child theme and not the cms template.

Can you please point me to exactly where i need to begin inserting the text?

Thanks
#indexphp #inserting #text or content #wordpress
  • Profile picture of the author kumarraj
    Originally Posted by Dele View Post

    Hi Warriors,

    Happy New Year!

    I previously had my own inserted content right within Main Index Template (index.php) of my Wordpress blog but i removed same sometime ago. I now want to re-insert some text but cannot recollect exactly where within the index.php code i should do that.

    Btw i am quite aware of the necessity for only amending/updating child theme and not the cms template.

    Can you please point me to exactly where i need to begin inserting the text?

    Thanks
    Hi,
    Happy New Year!

    It depends where you want to add the content. There are many files in a wp theme, normally there would be a header.php file you can add content there after opening body tag, that would be displayed all over the pages, provided that file is included in all the other theme files, and the next thing is you should know the place where you want to include the text.

    I can provide more specific help if you can give me more details where you want and your site url.
    Regards,
    Raj
    {{ DiscussionBoard.errors[9782932].message }}
    • Profile picture of the author Dele
      Thank you Raj.

      I want the content in the Main Index Template (index.php) as that is where i had it before. I want it rendered on my site homepage after the dynamic content (blog posts).
      My site url is Profitable Business Ideas - Ideas That Make Money Online
      Signature

      What Others Are Saying About This Top MLM Company | Get Brand New, Brand Name Products For Pennies @ New Penny Auctions | Play Online Game At Eager Zebra Games | The source through which i smile to the Bank daily with $$$ => Top Home Based Businesses

      {{ DiscussionBoard.errors[9783402].message }}
      • Profile picture of the author kumarraj
        I have checked your site and to add content after blog posts you need to find this

        Code:
        <div id="primary" class="hfeed">
        and before that closing div tag you need to add the following code, this will ensure that your additional content is posted on the home page only, and to the position where you actually want it.

        Code:
        <?php if ( is_front_page() ){?>
        add your content here
        <?php }?>
        Let me know if you require any other help.
        Regards,
        Raj
        {{ DiscussionBoard.errors[9784483].message }}
        • Profile picture of the author Dele
          Thank you so much Raj.
          I have now been able to insert the content as desired.
          Signature

          What Others Are Saying About This Top MLM Company | Get Brand New, Brand Name Products For Pennies @ New Penny Auctions | Play Online Game At Eager Zebra Games | The source through which i smile to the Bank daily with $$$ => Top Home Based Businesses

          {{ DiscussionBoard.errors[9785569].message }}
          • Profile picture of the author kumarraj
            Originally Posted by Dele View Post

            Thank you so much Raj.
            I have now been able to insert the content as desired.
            You are welcome.
            {{ DiscussionBoard.errors[9788878].message }}

Trending Topics