A
A
Anton Natarov2016-04-01 21:57:22
PHP
Anton Natarov, 2016-04-01 21:57:22

Wordpress how to make a static page but using php, js?

I can not understand how it should pick up the content of the pages. I do according to Habrostatya .
There are pages, there are menus. titles on articles are displayed if I create the main page and create main-page.php
And insert a JS slider and static text there. naturally does not pick up anything. And if you do as the author points out on Habré, it also does not work.
while if I post like this

<section>
        <?php if (have_posts()): while (have_posts()): the_post(); ?>
            <?php the_content(); ?>
        <?php endwhile; endif; ?>
    </section>

and in the admin panel, the plain text is all okay. How can I connect so that the Php page is connected, and not posts from the admin panel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Natarov, 2016-04-01
@HanDroid

Understood already.
in the desired new template, insert a comment with the name.

/*
Template Name: main-page
*/

Change the page in the admin panel, set the page template in the attributes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question