首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >自定义模板无法在wordpress中工作

自定义模板无法在wordpress中工作
EN

Stack Overflow用户
提问于 2015-11-26 19:55:28
回答 4查看 2.1K关注 0票数 1

我是WordPress的新用户。我正在尝试创建一个WordPress主题,但是一个定制的模板无法工作。它的显示--未在此服务器上找到所请求的URL /wordpresstheme主题/resources/。

我在- page-resources.php es.php之后创建了一个页面名

我的代码是

代码语言:javascript
运行
复制
<?php 
    /*
        Template Name: Resources Page

    */

 get_header();?>

我从我的管理页面面板中选择了它,并且没有使用默认的模板。

请帮帮我。

EN

Stack Overflow用户

发布于 2015-11-26 20:21:30

尝试这个例子,并为您调整:

代码语言:javascript
运行
复制
<?php
/**
 * Template Name: Contributor Page
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

get_header(); ?>

<div id="main-content" class="main-content">

<?php
    if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
        // Include the featured content template.
        get_template_part( 'featured-content' );
    }
?>

    <div id="primary" class="content-area">
        <div id="content" class="site-content" role="main">
            <?php
                // Start the Loop.
                while ( have_posts() ) : the_post();
            ?>

            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <?php
                    the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );

                    // Output the authors list.
                    twentyfourteen_list_authors();

                    edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' );
                ?>
            </article><!-- #post-## -->

            <?php
                    // If comments are open or we have at least one comment, load up the comment template.
                    if ( comments_open() || get_comments_number() ) {
                        comments_template();
                    }
                endwhile;
            ?>
        </div><!-- #content -->
    </div><!-- #primary -->
</div><!-- #main-content -->

<?php
get_sidebar();
get_footer();
票数 0
EN
查看全部 4 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33946133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档