custom-content-portfolio icon indicating copy to clipboard operation
custom-content-portfolio copied to clipboard

Ability to assign a page as the permalink base

Open frankiejarrett opened this issue 8 years ago • 8 comments

Rather than only being able to set a hardcoded custom permalink base, it would be quite handy to simply select an existing post ID.

screen shot 2016-02-29 at 11 18 54 pm

Of course custom permalinks should still be allowed just as they are now.

screen shot 2016-02-29 at 11 16 45 pm

Additionally, this opens up the possibility to easily use the Portfolio archive as the front page!

screen shot 2016-02-29 at 11 19 45 pm

Bonus: The permalink labels updating with keyup and select change.

frankiejarrett avatar Mar 01 '16 16:03 frankiejarrett

The only purpose of assigning the archive to a page that I can see is so that the archive can be set to the front page of the site. Any other benefits?

For the front page thing, there are probably better methods of handling that. It'd probably be better to add the portfolio project archive as an option for the front page.

justintadlock avatar Mar 01 '16 17:03 justintadlock

On the front page:

Here's what I have in mind. Go to Settings > Reading in the WP admin. Under "Front page displays", there should be 3 options:

  • Your latest posts
  • A static page (select below)
  • Portfolio

That's from the UI side of things. I'm not sure what that'd take under the hood. It's something that could probably be built as a separate plugin that we could test and incorporate back into the main plugin.

justintadlock avatar Mar 01 '16 18:03 justintadlock

@justintadlock I love this idea. And the logic should be as easy as a pre_get_posts hook like was done here.

frankiejarrett avatar Mar 01 '16 18:03 frankiejarrett

Yeah this is going to be a PITA. I'll whip up a feature plugin and give it a shot.

frankiejarrett avatar Mar 01 '16 18:03 frankiejarrett

@justintadlock Please give this a spin https://github.com/fjarrett/ccp-front-page

frankiejarrett avatar Mar 01 '16 19:03 frankiejarrett

I've been playing around with it. There's problems that creep up such as the <title> showing the portfolio title instead of the site title, breadcrumb scripts not recognizing this setup, and other issues. These are things I didn't really think of before. Maybe is_front_page() isn't returning true?

I need to sit on this a bit. Think it over.

Related core WP ticket: https://core.trac.wordpress.org/ticket/19958

justintadlock avatar Mar 11 '16 19:03 justintadlock

The only purpose of assigning the archive to a page that I can see is so that the archive can be set to the front page of the site. Any other benefits?

Currently there is no easy way for a non dev to add the portfolio archive to a menu, since the archive does not show up in the menu editor. Being able to assign the archive to a page would help avert end user confusion and make CPP super easy to add to an existing site.

noraheuer avatar Jan 12 '17 19:01 noraheuer

You can simply go to "Appearance > Menus > Projects > View All". From there, the first item is the "Projects" archive. Same with any CPT that has an archive and menu support.

justintadlock avatar Jan 12 '17 20:01 justintadlock