2

I use norebo theme

I use it when I open a Portfolio the link is in this format

https://www.hshnorm.com/project/fruit-flavored-powder-juice/

How can I remove the word project

To be the link in this format

https://www.hshnorm.com/fruit-flavored-powder-juice/

2 Answers 2

0

is project a custom post type? if so, it's been answered here Custom Post Type URL Rewriting?

but, if that is a regular post, it would be in the Settings > Permalinks to set the permalinks.

2
  • "rewrite" => array( "slug" => "project", "with_front" => true ), "rewrite" => array( "slug" => "/", "with_front" => true ),
    – amer sayed
    Commented Nov 28, 2020 at 13:02
  • yes, make it 'rewrite' => array('slug' => 'projects','with_front' => false),
    – Tiyo
    Commented Nov 29, 2020 at 0:03
0

use the str_replace.

$a = 'https://www.hshnorm.com/project/fruit-flavored-powder-juice/';
$b = str_replace( 'project/', "", $a );
echo $b;
2
  • 1
    I'd guess it's not that simple: I assume the problem is configuring WordPress so that get_permalink() doesn't generate the /project/ in the first place - or whichever prefix - and so that it accepts routes without it correctly too.
    – Rup
    Commented Nov 28, 2020 at 7:32
  • it's very possible, in that case the code generated is on a folder call project inside the active theme, maybe retriving it from that folder has the effect desired. But it would be better if it could be done on the dashboard, I dont know how.. Commented Nov 28, 2020 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.