我有自定义帖子类型(
my_product
)在WordPress中,当我点击阅读更多链接以显示帖子详细信息但它返回 single.php 页面而不是 single_product.php 页面模板。 任何帮助。 这是我的代码:
package javaapplication50;
import java.util.Scanner;
public class JavaApplication50 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println(" > Enter students Grades: ");
System.out.print(" > Enter the grade of Aptitude Test : ");
double message = in.nextDouble();
readStudentGrade(message);
System.out.print(" > Enter the grade of Introductory Year : ");
message = in.nextDouble();
readStudentGrade(message);
System.out.print(" > Enter the grade of School : ");
message = in.nextDouble();
readStudentGrade(message);
public static double readStudentGrade(double message) {
while (true) {
if (message >= 0 && message <= 100) {
return message;
} else {
System.out.println("");
System.out.println(" > Invalid input! (must be between 0 and 100)\n"
+ " > Please try again.");
System.out.println("");
}
return message;
}
}
}
答案 0 :(得分:2)
您使用的是错误的文件,您必须使用single-my_product.php这是single-post_type,此处您的帖子类型为my_product,因此请使用single-my_product.php而不是single-product.php。