• 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)
  • 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 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.

    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!!

    You may find here my question about this topic.
    I hope to hear from you!

    Thread Starter sohbetodamorg

    (@sohbetodamorg)

    @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 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

    (@sohbetodamorg)

    @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(); ?>
    

    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.