php - WordPress 子页面

标签 php css wordpress

有人要求我在 Wordpress 中设计一个网站。粗略的设计如下所示:

enter image description here

所以我想要的是当我点击关于时它应该展开并显示页面内容。有点像这样:

enter image description here

有人知道在同一位置显示页面内容而不是在新页面或窗口中打开吗?

提前致谢..:)

编辑1

下面是page.php的php代码

 <?php get_header(); ?>
 <div id="content" class="page">

 <div id="box">
  <h3><?php the_title(); ?></h3>

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
        <?php the_content(); ?><br /><div style="clear:both;"></div>
    </div>
<?php endwhile; ?>
<?php endif; ?>   

我希望菜单如图所示显示。所以根据 Arconix Shortcode Collection 的教程,它说我必须编写代码作为示例

  [accordions]
  [accordion title="About"]
  About Content here
  [/accordion]
  [accordion title="Results"]
  Results Content here
  [/accordion]
  [accordion title="People" last="last"]
  People Content here
  [/accordion]
  [/accordions]

现在,我希望它成为我们所写的内容而不仅仅是内容

1) 一个页面的内容,例如关于它的内容来自 About 页面的内容(因为页面可以在 wordpress Pages--->new page 中创建。所以如果我想要编辑它,我只需转到页面并编辑关于页面)。

2) 内容应该只有在鼠标点击后才会显示..

编辑2

在我想包含 Accordion 的页面中,我从页面中选择给定的选项

enter image description here

一旦我点击它。没有选择页面的选项,如下所示:

那么有人对此有任何想法吗?

enter image description here

最佳答案

有一个 WordPress 插件可以轻松完成此操作 - http://wordpress.org/extend/plugins/arconix-shortcodes/

带有此插件的 Accordion 文档位于 https://arconixpc.fogbugz.com/default.asp?W4

(该插件还有更多功能。)

关于php - WordPress 子页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11430123/

相关文章:

javascript - 如何以编程方式将 JS 和 CSS 资源添加到 <h :head>

php - Woocommerce - 如何实现缩略图的灰色覆盖效果?

php - 从 CakePHP 中的 saveAll() 检索插入的 ID

javascript - Magento 重复加载 JS CSS 文件

html - 老板平板电脑上的细条纹

wordpress - 如何在 Google Compute Engine 中安装我的 Comodo SSL 证书?

html - 均匀分布菜单

PHP函数根据输入获得相同的输出

php - 基于所选复选框的 SELECT 查询

html - 我试图将文本居中放置在我的页面 HTML 中间