Title: Insert plugin code into frontpage.php in theme editor
Last modified: September 1, 2016

---

# Insert plugin code into frontpage.php in theme editor

 *  Resolved [shaaruddin](https://wordpress.org/support/users/shaaruddin/)
 * (@shaaruddin)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/)
 * Hi, My website main page is not normal wordpress page. I am using template in
   theme for my frontpage. So how do I add this plug in code into my front page 
   php code in order for me to trigger this plug in on my website ?
 * [https://wordpress.org/plugins/popup-builder/](https://wordpress.org/plugins/popup-builder/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * (@popup-by-sygnoos)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464275)
 * Dear [@shaaruddin](https://wordpress.org/support/users/shaaruddin/),
 * To insert the popup on your main page, go to your theme’s index.php (main file).
   Insert the following code there: <?php echo do_shortcode(‘[sg_popup id=”1″][/
   sg_popup]’); ?>
    This way you’ll have an on load kind of popup. We can offer 
   you another thing. In our Pro version you can select the homepage from the options
   and your popup will open on load without any codes typing.
 * Best regards,
    Sygnoos Team.
 *  Thread Starter [shaaruddin](https://wordpress.org/support/users/shaaruddin/)
 * (@shaaruddin)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464450)
 * Wow, Thank you very much.
 *  [ktrides2](https://wordpress.org/support/users/ktrides2/)
 * (@ktrides2)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464559)
 * I just pasted that code and now I am locked out of my site.
 * Parse error: syntax error, unexpected ‘<‘ in /home/ktrides22/public_html/modernmotomag.
   com/wp-content/themes/tracks-child/functions.php on line 31
 *  [Sygnoos](https://wordpress.org/support/users/sygnoos/)
 * (@sygnoos)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464560)
 * Dear [@ktrides2](https://wordpress.org/support/users/ktrides2/),
    Are you sure
   you have inserted code in a correct place (‘wp-content/themes/tracks-child/index.
   php’)? Also, check if you don’t miss anything like `;`, `<`, `>` and so on. Anyway
   if you have FTP credentials to your Website you can revert changes.
 * Feel free if you need any further assistance!
 * Best Regards,
    Sygnoos Team.
 *  [ktrides2](https://wordpress.org/support/users/ktrides2/)
 * (@ktrides2)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464561)
 * [@sygnoos](https://wordpress.org/support/users/sygnoos/),
    Well that was all 
   me – I accidentally pasted it into functions.php instead of index.php. This is
   my first time working a child theme and I don’t have an index.php file for it.
   Do I just create a blank one and this line of code would be the only thing in
   it for now or do I copy the entire main theme’s index file to my child and then
   add this? Sorry this is veering away from the plugin question. This is the 3rd
   pop-up plugin I have tried this week, I really want to make it work, it is the
   most user friendly so far, even with the extra step for the home page.
 *  Thread Starter [shaaruddin](https://wordpress.org/support/users/shaaruddin/)
 * (@shaaruddin)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464563)
 * Hi [@ktrides2](https://wordpress.org/support/users/ktrides2/)
 * I think you have to go your functions.php and look for this code <?php echo do_shortcode(‘[
   sg_popup id=”1″][/sg_popup]’); ?>. Then remove that line of code and everything
   is fine if its just the problem.
 *  Plugin Contributor [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * (@popup-by-sygnoos)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464564)
 * Dear [@ktrides2](https://wordpress.org/support/users/ktrides2/),
 * Please, let us know if your issue is solved.
 * Best regards,
    Sygnoos Team.
 *  [ktrides2](https://wordpress.org/support/users/ktrides2/)
 * (@ktrides2)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464566)
 * It is not resolved, I still don’t know where to paste the code if I do not have
   an index.php file in my child theme.
 * Thank you [@shaaruddin](https://wordpress.org/support/users/shaaruddin/), I already
   removed that from functions and am back in my site, the problem is as stated 
   above.
 * Thank you.
 *  Plugin Contributor [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * (@popup-by-sygnoos)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464568)
 * Dear [@ktrides2](https://wordpress.org/support/users/ktrides2/),
 * Could you, please, tell us the name of the theme you’re using so we can check
   what causes the issue.( [wp-popup@sygnoos.com](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/wp-popup@sygnoos.com?output_format=md))
   
   Also it would be helpful if you send us the files names under the child theme
   directory, so we can help you out.
 * Best regards,
    Sygnoos Team.
 *  [ktrides2](https://wordpress.org/support/users/ktrides2/)
 * (@ktrides2)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464569)
 * Theme is called Tracks. Style.css and functions.php are the only files in my 
   child theme right now.
 * Thanks so much Sygnoos.
 *  Plugin Contributor [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * (@popup-by-sygnoos)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464570)
 * Dear
 * Your function’s php probably is an empty file, so, please, insert this code into
   your function’s php. (The id in the code is your popup’s id, write the id of 
   your popup e.g. id=”1″)
 *     ```
       add_action('wp_head','showPopupInChildTheme');
   
       function showPopupInChildTheme() {
            echo do_shortcode('[sg_popup id="1"][/sg_popup]');
       }
       ```
   
 * Please, try so and let us know when you succeed.
 * Best regards,
    Sygnoos Team.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Insert plugin code into frontpage.php in theme editor’ is closed to new
replies.

 * ![](https://ps.w.org/popup-builder/assets/icon-128x128.gif?rev=2698840)
 * [Popup Builder - Create highly converting, mobile friendly marketing popups.](https://wordpress.org/plugins/popup-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/popup-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/popup-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/popup-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popup-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popup-builder/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [plugin-code](https://wordpress.org/support/topic-tag/plugin-code/)

 * 11 replies
 * 4 participants
 * Last reply from: [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/insert-plugin-code-into-frontpagephp-in-theme-editor/#post-7464570)
 * Status: resolved