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