【问题标题】:Single Page Wordpress Template单页 Wordpress 模板
【发布时间】:2013-06-12 21:42:42
【问题描述】:

我必须将以下 HTML 网站转换为 Wordpress 的主题。我试图弄清楚如何根据页面/帖子/自定义模块和主题来构建主题。

我的页面中有 5 个部分

  1. 首页(滑块和内容)
  2. 知道(包含内容的标签)
  3. 查看(具有可过滤效果的项目)
  4. 阅读(博客和文章)
  5. 谈话(联系表格)

我想让客户能够编辑页面上的大部分内容。

请指导我开始。

链接:http://play.mink7.com/sophiance/

*编辑*

我创建了一个名为'home' 的页面,并在settings>reading> 中选择了它作为网站的静态内容。

接下来我创建了一个名为template-home.php 的模板,并选择了home 来使用这个模板。

【问题讨论】:

  • 就目前而言,这是非常广泛的。您的具体问题是什么?
  • @Pekka웃 更新了我的问题

标签: wordpress wordpress-theming wordpress-3.5


【解决方案1】:

在您的 index.php 文件中放置 5 个部分。

在每个部分中 - 创建一个新查询来拉取页面。

例如使用自定义帖子类型

  <section id="home">
    //Slider Content
<?php query_posts('pagename=home'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?>//Loop Content
<?php endwhile; endif; wp_reset_query(); ?>
</section>

<section id="know">
<?php query_posts('pagename=know'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?>//Loop Content
<?php endwhile; endif; wp_reset_query(); ?>
</section>

等等

然后使用该名称创建每个页面,它将提取数据

我创建了一个类似here的网站

【讨论】:

  • 每个部分都必须定义为一个页面?并且还定义了自己的模板?我需要使用自定义字段吗?
  • 我通过对每个页面进行查询来做到这一点。所以你可以写&lt;?php query_posts('pagename=home'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?&gt;//Loop Contnet &lt;?php endwhile; endif; wp_reset_query(); ?&gt; 并且每个由该名称创建的页面都会被拉取。
  • 谢谢,我会试试的。如果我有任何问题,请回复您
  • 我可以为每个部分创建自定义字段,以便允许用户编辑内容吗?你能指导我怎么做吗?
【解决方案2】:

这是您应该如何构建您的 Wordpress 网站的方式:

Home (Slider and content) - create a page called Home and a custom page template called home

Know (tabs with content) - use a shortcode plugin to have tabbed content, default page template

View (Projects with filterable effect) - use a plugin that displays content in a masonry layout, default page template

Read (blog and articles) - create posts (under posts) and display them using the post archive.

Talk (contact Form) - use default page template and a plugin like Gravity Themes for the contact form

有关如何构建您的 Wordpress 网站的类似想法,请访问 http://www.mybuzzmedia.net

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-09
    • 1970-01-01
    • 2015-12-22
    • 1970-01-01
    • 2012-10-08
    • 1970-01-01
    相关资源
    最近更新 更多