小编kal*_*mar的帖子

让Geany识别其他文件扩展名

我在Debian上的默认Geany安装无法识别开箱即用的某些文件类型.为简单起见,如何使用与其他已知扩展相同的语法突出显示添加扩展?

在目前的情况下,我希望Geany打开所有.aspx文件,并使用与.html文件相同的突出显示.

syntax-highlighting text-editor geany

11
推荐指数
1
解决办法
5850
查看次数

WordPress 自定义帖子类型上带有动态重写标签的自定义永久链接

我有一个名为的自定义帖子类型location,我正在尝试将此类型的帖子设置为现有页面的子级,以实现如下所示的永久链接结构:

example.com/alabama  <-- Page with generic content
example.com/alabama/locations  <-- Another page, child of a state page
example.com/alabama/locations/location-name  <- Custom type, child of alabama/locations seen above and titled `Location Name`
Run Code Online (Sandbox Code Playgroud)

我在两种不同的帖子类型之间创建层次关系的最接近方法是通过元框,post_parent在保存帖子时,我可以将帖子 ID 指定为自定义类型帖子的 ID。然而,尽管页面 ID 确实保存到了 CPTpost_parent字段,但它对永久链接没有影响。它们按照rewriteCPT 选项中的定义来提供。但我不知道如何使该['rewrite']['slug']选项动态化,或者是否可能。

这就是我的帖子类型的定义方式:

add_action( 'init', function() {
  register_post_type( 'location', [
    'label' => 'Location',
    'menu_icon' => 'dashicons-location-alt',
    'supports' => [ 'title', 'editor', 'custom-fields' ],
    'public' => true,
    'hierarchical' => false,
    'has_archive' => false,
    'rewrite' => false, …
Run Code Online (Sandbox Code Playgroud)

wordpress permalinks

2
推荐指数
1
解决办法
3874
查看次数