简体   繁体   中英

Google map API in Homepage - Wordpress

I am new to WordPress. I need to use the google API in my homepage. what I have done is create a custom template and done all my work there, but now I need to show all the code on my homepage, and I don't know where to put that code. Because I am unable to find the homepage.php or anything like this. Just give me an idea how to do this ?

  1. Create a page in backend home page and select as your frontpage. Apperenace -> Customize -> staticpage-> and your page name to make it home page and now put the code in that file .

Or 2.follow these steps: step 1-> Create a page-tamplate folder in wp-content folder step 2-> Create a php file and add the below code at the top

<?php

/** * Template Name: Home page * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */

Your google api code or your home page code

Step 3-> now create a page from backend and aasign the page-tamplate Home page and published that your code will be visible on home page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM