Title: WordPress HTML Static Page
Last modified: October 20, 2016

---

# WordPress HTML Static Page

 *  [sohbetodamorg](https://wordpress.org/support/users/sohbetodamorg/)
 * (@sohbetodamorg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/)
 * Hello,
 * I created on the domain folder “landing” and insert basic html (php) page. This
   page use wp_query and grab content from wordpress. This working no problem.
 * My first question is how can i redirect wordpress or htaccess to static page 
   on domain load. I want a run also wordpress index.php with in html page. How 
   can I do this?
 * Second question if this solve how can I use canonical on html (php) page side?
 * Thanks,

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8336580)
 * The first question that I’d ask is… Why do you want to do this? Ther’s better
   ways to do this rather then what you’re suggesting.
 * As a warning, all of these changes should be done in a [child theme](https://codex.wordpress.org/Child_Themes)
   so you don’t loose them when your theme is updated.
 * All you need to do is create a new file in your child theme called `front-page.
   php`, paste in all of the HTML code that you had for your static page and set
   your site to have a static homepage (see ‘Appearnce -> Reading’ in your admin
   area). WordPress will use this file as the template for your home page, so there’s
   no need to do anything else.
 *  [eletoedica](https://wordpress.org/support/users/eletoedica/)
 * (@eletoedica)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8339491)
 * Hi sohbetodamorg,
 * sounds like you managed to do exactly what I’m interested in: create a basic 
   html (php) page that “grabs content from wordpress”.
 * Can you tell the url of your landing page or explain the code you inserted in
   it?
    Thanks!!
 *  [eletoedica](https://wordpress.org/support/users/eletoedica/)
 * (@eletoedica)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8339505)
 * You may find [here](https://wordpress.org/support/topic/insert-wp-in-a-html-website/)
   my question about this topic.
    I hope to hear from you!
 *  Thread Starter [sohbetodamorg](https://wordpress.org/support/users/sohbetodamorg/)
 * (@sohbetodamorg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8342179)
 * [@catacaustic](https://wordpress.org/support/users/catacaustic/) hello, my purpose
   I’m created lot of content start and end titles with Sohbet and Sohbet Odaları
   keyword. I think google mark spam and made seo problems. My competitors most 
   usely landing page and use background blog with wordpress.
 * [@eletoedica](https://wordpress.org/support/users/eletoedica/) yes but I use 
   one content on landing page and content is very long. I want give the landing
   page privately if you want a inspect this.
 * Thanks everyone
 *  Thread Starter [sohbetodamorg](https://wordpress.org/support/users/sohbetodamorg/)
 * (@sohbetodamorg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8342191)
 * [@eletoedica](https://wordpress.org/support/users/eletoedica/)
 * Used PHP codes in html files (file not html exactly I changed extension to php)
 * After the body
 *     ```
       <?php require('../wp-blog-header.php');
         /*if you are getting 404 errors uncomment the next 2 lines*/
         status_header(200);
         nocache_headers();
       ?>
       ```
   
 * Then content
 *     ```
       <?php $the_query = new WP_Query( array( 'page_id' => 464 ) ); ?>
   
       <?php function custom_excerpt_length( $length ) {
       if ( is_category() || is_archive() ) {
       return 20;
            }
       else{
       return 1500;
         }
       }
       add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); ?>
   
       <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
       <h1 class="title entry-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
       <?php the_excerpt(__('(devamı...)')); ?>
   
       <?php endwhile; wp_reset_postdata(); ?>
       ```
   
 *  [eletoedica](https://wordpress.org/support/users/eletoedica/)
 * (@eletoedica)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8344972)
 * Hi sohbetodamorg, thank you very much for the code!!!
    I’ll study it, I hope 
   it will work for my website too. 🙂 🙂 🙂 Ele

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

The topic ‘WordPress HTML Static Page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [eletoedica](https://wordpress.org/support/users/eletoedica/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/wordpress-html-static-page/#post-8344972)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
