【问题标题】:wordpress : identify user way to an itemwordpress :识别用户访问项目的方式
【发布时间】:2013-06-03 14:08:48
【问题描述】:

是否可以跟踪用户到达页面的路线?

假设我的帖子有 2 种不同的分类法 分类 1 = 制作 分类 2 = 颜色

我想为每条路线创建不同的布局

这是我当前的层次结构:

Mercedes -> blue     -> car - the user gets template 1 (single-car.php)
blue     -> Mercedes -> car - the user gets template 1 (single-car.php)

这就是我想要的

Mercedes -> blue     -> car - the user will get template 1 (single-car_by_make.php)
blue     -> Mercedes -> car - the user will get template 2 (single-car_by_color.php)

不使用额外的查询字符串可以吗?

【问题讨论】:

    标签: wordpress templates custom-taxonomy


    【解决方案1】:

    我不是在编写实际代码。但我只是给出了如何去做的想法。

    在您的 single-car.php 文件中使用以下逻辑

    如果(分类法 == 制作) get_template_part('single-car_by_make');

    如果(分类 == 颜色) get_template_part('single-car_by_color');

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2019-12-27
      • 2020-02-03
      • 1970-01-01
      • 1970-01-01
      • 2013-03-16
      • 1970-01-01
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      相关资源
      最近更新 更多