[英]How to make Wordpress Custom page
ima newbie to wordpress. ima newbie to wordpress。 I have started theme development and encountered these problems.
我已经开始主题开发并遇到了这些问题。 I think these kind of problem does have a solution, but im not able to find it out.
我认为这类问题确实有解决方案,但我无法找出答案。
I m trying to make a custom page. 我正在尝试制作自定义页面。 Uptill now i have made header, footer and main index page.
到目前为止,我已经制作了页眉,页脚和主索引页面。 I see that whenever my theme is activated, I see these default index page, with header and footer assign to it.
我看到,只要激活了主题,就会看到这些默认的索引页,并为其分配了页眉和页脚。 I have also made some cutom about us , contact us pages using the Add Pages Functionality of wordpress.
我还对我们做了一些评论,请使用wordpress的“添加页面功能”与我们联系页面。
My Problem: 1.Now I m trying to make custom product page where I will have more than 100 images on that pages, and then i can change the images, add the images and description and the link url in future. 我的问题:1.现在,我试图制作自定义产品页面,在该页面上我将拥有超过100张图像,然后可以更改图像,添加图像和说明以及将来的链接URL。 I have made some html code and put it in the text Tab .
我做了一些html代码,并将其放在文本Tab中。 I can also see the images on the frontend of the Custom page.
我还可以在“自定义”页面的前端看到图像。 But my template breaks.
但是我的模板坏了。 Images goes up and description goes far below.
图像上升,说明远不及以下。
So can we make custom.php page and do some coding or anything which you feel is the right way of doing it, Please let me know. 因此,我们可以制作custom.php页面并进行一些编码还是您认为正确的方法,请告诉我。
Firstly create product.php
page in templates folder using below code on top 首先使用下面的代码在模板文件夹中创建
product.php
页面
<?php
/*
Template Name: My Product Page
*/
get_header();
// write your code here
get_footer();
Then, assign the above template to the page in admin. 然后,将上述模板分配给admin页面。 Then, that page you can call in menu.
然后,您可以在菜单中调用该页面。 For more detail, check here :- http://codex.wordpress.org/Page_Templates
有关更多详细信息,请在此处检查: -http : //codex.wordpress.org/Page_Templates
Actually you don't really need to create a custom template for this unless if you are planing to use that same template on another page. 实际上,除非您打算在另一个页面上使用相同的模板,否则实际上并不需要为此创建自定义模板。
If your page name is products , just create a file called page-products.php in your theme root. 如果您的页面名称是products,只需在主题根目录中创建一个名为page-products.php的文件。 and write your code inside that page.
并在该页面中编写代码。
If your planing to develop themes first be comfirtable with wp template hierarchy. 如果您打算开发主题,那么首先要与wp模板层次结构兼容。 http://codex.wordpress.org/Template_Hierarchy
http://codex.wordpress.org/Template_Hierarchy
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.