Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Inserting Text/Content In Index.php (Wordpress) (https://www.warriorforum.com/programming/1032544-inserting-text-content-index-php-wordpress.html)

Dele 2nd January 2015 08:54 AM

Inserting Text/Content In Index.php (Wordpress)
 
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

kumarraj 2nd January 2015 10:02 AM

Re: Inserting Text/Content In Index.php (Wordpress)
 
Quote:

Originally Posted by Dele (Post 9782790)
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

Dele 2nd January 2015 02:16 PM

Re: Inserting Text/Content In Index.php (Wordpress)
 
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

kumarraj 3rd January 2015 12:24 AM

Re: Inserting Text/Content In Index.php (Wordpress)
 
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

Dele 3rd January 2015 11:41 AM

Re: Inserting Text/Content In Index.php (Wordpress)
 
Thank you so much Raj.
I have now been able to insert the content as desired.

kumarraj 5th January 2015 01:01 AM

Re: Inserting Text/Content In Index.php (Wordpress)
 
Quote:

Originally Posted by Dele (Post 9785569)
Thank you so much Raj.
I have now been able to insert the content as desired.

You are welcome.


All times are GMT -6. The time now is 06:17 PM.