将 WordPress 帖子提要放入
大家下午好! 我在这里尝试了几种不同的选项,但对此我束手无策:
我正在一个具有静态 .php 页面的旧网站上工作。所有者需要在子文件夹中创建 WordPress 安装...没问题。
但是,我需要静态主页上的菜单以及一些具有以下菜单的静态子页面:
有什么想法可以如何从 WordPress Feed 在静态页面上动态生成此菜单吗?
Good afternoon all!
I've tried several different options here but am at my wits end with this:
I'm working on an older site that has static .php pages. The owner needs a wordpress installation created in a sub folder.... no problem.
However, I need a menu on the static home page as well as some static sub pages that have the following menu:
Any ideas how i can dynamically generate this menu on the static pages from the wordpress feed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您愿意在 PHP 页面上运行一些快速而肮脏的 MySQL,您可以执行查询来获取页面列表:
您需要使用 JavaScript 使下拉列表根据需要跳转到每个页面,这导致我我的下一点。这种方法不利于 SEO,而且还依赖于用户启用 JavaScript 才能发挥作用。
If you're comfortable running some quick and dirty MySQL on the PHP pages, you could do a query to get a list of the pages:
You would need to use JavaScript to make the dropdown jump to each page as required, which leads me to my next point. This method is not good for SEO and it also relies on users having JavaScript enabled in order for it to work.