I
I
Insom842017-03-10 12:53:23
Blogs
Insom84, 2017-03-10 12:53:23

Attaching a landing page to a blog?

Hey!
Please tell me the easiest and best way to do it. I have a landing page in html, I need a blog for it. I'm thinking of using a wordpress blog template so as not to write a blog from scratch (but just change the template for myself). How can I properly attach my landing page to WordPress and blog template? There is only one article on the net about how to attach a WordPress blog to a landing page (web-andryshka.ru/kak-prikrutit-k-lendingu-blog-na-wordpress/), but there are many jambs that pop up with css loading, and indeed I Seems like an inappropriate approach.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2017-03-10
@Insom84

You can do the following:
- Define in the theme on wordpress, where the blog is supposed to be placed, 2 files:
- - header-landing.php
- - footer-landing.php
Accordingly, in them, in the header you define styles, head and so on. scripts in the footer. And you stuff the middle part into index.php in the theme folder, moreover, I suspect that your landing page will be on the main one (and this index.php will be responsible for this), and in the menu there will be an item somewhere, for example with an arbitrary link "Blog", it will lead to the address, for example site.ru/category/posts (well, for this you create the posts section from the box in wp and shoot your posts there)
index.php:

// в шапку выносишь все то, что ты хочешь видеть в шапке, то есть, то что постоянно на каждой странице тут
<?php get_header("landing"); ?>

// здесь html твой, средней части лэндинга

// тоже самое футер, срипты итд
<?php get_footer("landing"); ?>

Then you make a dynamic menu (your own), screw it into the header, anywhere (but before that, register it in functions.php [menu_name]), output it as a function in any, for example
<?php
$args = [
  'theme_location' => 'menu_name'
];
 wp_nav_menu($args);?>

Then, in the admin panel, you can already add an item to the "Blog" menu, give it a link to the posts category, and that's it. On the main landing, the link is a blog. But in general, everything is individual, depending on what topic you have there, maybe you still need to dig, look at the settings in the admin panel, but the essence is initially like this. How I see it
...
And in this case, it’s not easier to do this: on the server, at the root of the landing page, there is one page (index.htm) from the css and javascript and images folders. Create another directory, blog, install wp there with any theme. And thus it will be on the main landing, and when you go to /blog/, it will open and process wp requests. (You may need to slightly tweak /blog/ .htaccess or VirtualHost so that the blog entry point is /blog/index.php, or root on nginx ). Well, in principle, it will not be necessary to prescribe anything anywhere else, in functions.php and so on. If we catatomize something in the topic, we already go to /blog/ and dig there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question