最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

page template - Modify Custom Post Type Slug

programmeradmin1浏览0评论

I have a CPT called 'projects', which display images with their titles.
I have a page to display the CPT's called 'single-projects.php'.

Is there a way through using templates and/or functions, to display the slugs like this:

  • themename/projects/project/
    This is so I can show all the CPT's in that project list on the single-project page.

instead of

  • themename/projects/slug-of-post
    This doesn't make sense to have each unique post slug if I am just showing one page for all CPT's in that list. I tried the rewrite argument, but I only want to change the slug-of-post.

I know I can change the slug for each CPT in their dashboard, but I want to do it via the back-end.

In my front-page I tried to use echo site_url('/single-project') for the image links but that doesn't work, am I doing it incorrectly?

发布评论

评论列表(0)

  1. 暂无评论