0

我正在将单页 html 网站转换为静态 wordpress 网站。原来的html主页(唯一的页面)主要是使用jquery,当点击远处菜单中的一个选项时,下拉一个小文本区域。附加我转换后的主题的 index.php。

<div class="content" id="content1">
<a href="" onclick="deanimate('content1')"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/close.png" style="position:absolute; right:5px; top:5px; width:15px;"/></a>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/face.png" style="padding-left:15px; padding-top:20px; width:454px;" />
</div>


<div class="content" id="content2">
<a href="" onclick="deanimate()"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/close.png" style="position:absolute; right:5px; top:5px; width:15px;"/></a>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/face2.png" style="padding-right:15px; padding-top:30px; width:453px; height:200px;" />
</div>

等等..我想以这样的方式添加内容,我应该能够在 wordpress 应用程序中修改它而无需编辑主题文件?可能吗 ?wordpress 新手。帮助表示赞赏。

4

1 回答 1

0

是的,您可以从 wp-admin 编辑内容。在 admin 下的页面管理中,您可以创建页面,然后在 page.php 或您的模板文件中添加循环,它将显示您在 admin 中编写的内容。

<?php while ( have_posts() ) : the_post(); ?>
<?php the_title();?>
<?php the_content();?>
<?php endwhile;?>

使用上面的代码,您可以在浏览器上显示页面管理内容。

于 2013-02-11T13:26:18.003 回答