Questions tagged [permalinks]

A permanent link to an item (a blog post, an attachment, ...). The default structure is "?p=123", but WordPress can handle "pretty permalinks" and will rewrite them internally to the former version. If you have a question about special rewrite structures you should use the [url-rewriting] tag.

Filter by
Sorted by
Tagged with
0 votes
1 answer
57 views

Getting back a permalink from custom url

okay i have made my own rewrite rule, with the add_rewrite_rule function in wordpress to get a custom url, for an plugin page. add_action( 'init', function() { add_rewrite_rule( 'login/?$', 'index....
bymem's user avatar
  • 11
0 votes
1 answer
60 views

Wordpress /page/2 gives 404 when custom permalinks is set to %category%%postname%

My wordpress permalink settings, Custom Structure: %category%%postname%. Used next_posts_link() in custom theme in archive.php to get next posts link. Result: Next Page >> (display as expected) ...
Akilan's user avatar
  • 1
0 votes
0 answers
684 views

Change Project permalink to custom URL

how do I change the permalink into a custom url? I want to link the project items to another website. Anyone have experience with this? How can I change that permalink into a custom url? For example ...
Ikez's user avatar
  • 1
0 votes
1 answer
1k views

How to update permalink programmatically?

After activating my plugin I should go to settings -> permalinks and click on the Save button to make custom endpoints ( for my-account page ) work. How can I do it programmatically? ( I used ...
amiwebdev's user avatar
0 votes
1 answer
400 views

Getting post URL within custom content template

This should be such an easy thing but it's giving me so much headache. I created a content template called content-sticky.php. Added all the code there <article id="post-<?php the_ID(); ?&...
user3170899's user avatar
0 votes
1 answer
35 views

Cannot make custom search permalink to work in a fully custom theme. Search string $_GET['s'] is always empty

I am learning to build a fully custom WordPress theme. I have a search form <form role="search" method="get" class="search-form" action="<?php echo home_url() ?...
Subrata Sarkar's user avatar
0 votes
1 answer
235 views

Child theme modifications not showing up

i am working on a job-portal site and i am little stuck into one situation . I uploaded a child theme and activated it. The child theme is activated successfully but it dosent show changes that i do ...
fyn matt 881's user avatar
0 votes
1 answer
904 views

Rewrite/Change custom taxonomy slug

I want this url: => mydomain.com/genre/chant to be rewritten as => mydomain.com/chambers/chant. I want the users to access mydomain.com/chambers/chant instead of mydomain.com/genre/chant. genre ...
Raghavendra N's user avatar
1 vote
1 answer
599 views

Can't get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together

Problem specification I'm implementing a website that is meant to host podcast shownotes and transcripts, and so I want custom permalinks and shortlinks for the webpages: Permalinks of the form /...
Jivan Pal's user avatar
  • 113
1 vote
1 answer
2k views

How to add_rewrite_rule with two parameters to a single view page?

I'm having troubles understanding how add_rewrite_rule works in my case. I have a page which lists news from an external source. All items are linked with a "read more". Those links look ...
ggzone's user avatar
  • 111
0 votes
0 answers
99 views

How do I get the correct URL?

Helo, WordPress Community! Help me, please. Created a custom post type with one taxonomy added as a category. Overwrite rules have also been created to display the complete structure of the CNC, for ...
Tolyan Dimov's user avatar
2 votes
2 answers
619 views

How do I make 301 redirection from `/%post_id%/` to `/%postname%/`?

My permalinks is set to /%post_id%/ (post id). https://elrons.co.il/%post_id%/ I want to change them all to /%postname%/ (which is the post slug). https://elrons.co.il/%postname%/ Problem is, whenever ...
Elron's user avatar
  • 159
-1 votes
2 answers
270 views

Accessing WordPress Functions get_permalink() in Vanilla PHP?

Simple question. I'm attempting to use get_permalink() in vanilla php but cannot access it. I have include_once all these "used" files: wp-settings.php wp-includes/load.php wp-includes/link-...
stkmedia's user avatar
0 votes
1 answer
209 views

How to remove the Sub category product URL Woocommerce

Default URL http:// mystore.com/parent-category/child-category/product I want to remove anything between parent-category and product so my urls look like: http:// mystore.com/parent-category/product ...
Son Tom Ford Có Chì Không's user avatar
0 votes
1 answer
80 views

How to redirect old permalinks to ones generated by [WP-Hashed-ID] plugin?

I've changed the permalink for WordPress post. Old permalink structure was using the 'post_id' and new one is hashed post id using the plugin WP-Hashed-ID. How can I enable redirection from links ...
Mustafa's user avatar
0 votes
1 answer
107 views

Redirect old /%category%/%postname%/ to just /%postname%/

I changed my posts permalinks from /%category%/%postname%/ to /%postname%/. Now all my old URLs are not working and I want to redirect them to new structure. How can I do that? I use nginx
Madno's user avatar
  • 101
0 votes
1 answer
136 views

How to get post permalink url without a href

I need code to get post url without a href, for example: <a href="http://mywebsite.com/permalink" rel="permalink">single post title</a> i just need the url like: http://...
Vincenzo Piromalli's user avatar
0 votes
0 answers
44 views

Home page is not loading, where in other pages are displaying on the site

My home page is not displaying on the site, but it is showing that the page is loading. and I have checked all other pages. Everything is working except the home page. Even the posts are also getting ...
Anusha Anamdas's user avatar
0 votes
0 answers
137 views

How to prefix `attachment` permalinks with `attachment`?

Could you please help me to prefix attachment permalinks with a custom string (for example attachment) Such that example.com/attachment-slug becomes example.com/attachment/slug? Apply only to posts ...
Mat Ej's user avatar
  • 1
0 votes
0 answers
156 views

Get category base permalink

i need to place category base permalink in my theme like this <?php if ( is_category('in-theaters') ) { ?> <li class="active"><a href="<?php echo esc_url( home_url() );...
Vincenzo Piromalli's user avatar
0 votes
0 answers
67 views

Alter post slug by a filter that is fired just after a post is created

) I found (for example in Set default (auto) slug prefix for Tags) that it is possible for example add my-taxonomy prefix in front of all taxonomy slugs (permalinks). The post is outdated now since ...
Mat Ej's user avatar
  • 1
1 vote
0 answers
32 views

Add custom post type settings to wordress default posts

When I create custom post types in wordpress I got the following site structure which works perfectly with Permalinks "/%category%/%postname%/": Preview and category page: [main]/animals/ [...
Steffan Schlüter's user avatar
0 votes
2 answers
748 views

how to get a list of all top level pages

I am trying to figure out how to get a list of the permalinks for top-level pages only. My goal is to put them in a selection box on a form. I have spent a couple of hours searching here for an answer ...
petebolduc's user avatar
0 votes
0 answers
115 views

How do you create pillar content pages?

I'm trying to create a guide/pillar page with subpages and I'm kinda lost. I'm going for something like this: https://www.digitalmarketer.com/digital-marketing where you have /main-keyword/sub-keyword ...
Cezar Halmagean's user avatar
0 votes
0 answers
81 views

How Can I Create a Friendly Slug for a Dynamic Page?

I built a dynamic page template that pulls biography information from a MySQL table. The page works fine but the URL is ugly. Officer-Biography/?ID=1 I have a set of canonical slugs that I want to use ...
jpollar's user avatar
  • 13
0 votes
0 answers
96 views

Yoast and permalink troubleshooting

For first let me introduce what I've already discovered. I don't know how Yoast calculates the permalink but it's non standard and that fact creates a lot of problems. There are some filters to force ...
Revious's user avatar
  • 313
0 votes
1 answer
83 views

Edit Post Permalink option removed, looking for possible causes

The edit post permalink button is totally removed ( not hidden with css ) from the edit view - but the slug is still editable from both the Quick Edit view and also via the "slug" panel ...
Q Studio's user avatar
  • 2,516
0 votes
0 answers
477 views

Code snippet to add filter pre_post_link to change Media URL (post_type attachment permalink/slug)

I found a very good code snippet to add a "base" into URL of blog posts: Custom permalink structure with a prefix just for posts I tested it and it works great for post_type: post (to test ...
Ben Hoven's user avatar
0 votes
2 answers
24 views

How to Link to Most Recent Custom Post of Same Term

Title says it all. I'm trying to link to the most recent post of a custom post type, but only within the same term. Currently my code successfully echos the correct term ID but doesn't show a link ...
ZackAkai's user avatar
0 votes
1 answer
147 views

How to construct a dynamic rewrite rule for child pages that passes more than one query var

I get a 404 error parent-page/any-child-page/?var1=x&var2=y&var3=z This is what I have so far: I want to have the rule cover any child page add_rewrite_rule('^project-centers/(...
mmeehan's user avatar
0 votes
1 answer
153 views

add all blog posts to folder

I want to add all the blog posts to the /blogs/the-post-name type structure. I can do this through the permalinks settings with: /blogs/%postname%/ but this also affects custom post types resulting ...
Daniel Florido's user avatar
0 votes
1 answer
32 views

Site Tagline ended up in permalink

When I added a custom tagline for my site in Customizer it made that tagline part of the permalink without my realizing it. I have turned off the tagline. It does not appear in the permalink settings ...
alvsa's user avatar
  • 1
2 votes
0 answers
29 views

Mixed unrelated taxonomy in permalink

we have a situation where we want to build permalinks using mixed (unrelated, ie not hierarchical) taxonomies in permalinks on a wordpress site. and we dont want the taxonomy name in the actual link. ...
Vauneen's user avatar
  • 21
1 vote
0 answers
73 views

How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?

(Forgive me, I know this question has been asked extensively but I haven't found an answer that works for me) I'm working on a website for a webcomic. I have a custom post type set up called "...
ZackAkai's user avatar
0 votes
0 answers
37 views

Permalink Issue | Too many redirects

I'm having an issue which I haven't come across before. I created a page with the same title as another existing page and as standard it gave it a -2 to the permalink for the new page so permalink &...
TwistedPixel88's user avatar
0 votes
0 answers
19 views

Modify category permalink to use post type slug

I have multiple custom post types and default post type that all need categories. Right now, each post type is using the default category taxonomy. I would like the archive category taxonomy URL to be ...
BrandenMB's user avatar
0 votes
0 answers
97 views

Create new page in wordpress plugin which doesn't exist

Sorry about confusing title but let me explain what I'm trying to do. I'm creating an online form in a plugin which allows the user to enter some values. Once they click on submit the new page should ...
Mohit Bumb's user avatar
1 vote
2 answers
1k views

Custom post type - how can I make it a sub-url of another page?

I've created a custom post type "testimonials" -- works fine, except I want the url to be "domain.com/results/testimonials" instead of "domain.com/testimonials" Do I just ...
ScottM's user avatar
  • 45
1 vote
0 answers
55 views

Possible to remove taxonomy from permalink if uncategorized?

I'm working on a client's website who requested that the custom search functionality I'm building out provide a number of 'pretty' permalinks that they can use for ad campaigns. The post types I'm ...
itsseanl's user avatar
0 votes
1 answer
22 views

Category permalinks don't work even after flushing

I have created a custom post type (portfolio) and I'm using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom ...
gillespieza's user avatar
  • 1,275
0 votes
1 answer
1k views

Images not loading on webpage, and links to other media give 404 Not Found

Had some recent problems where to start with only homepage text was visible, all other pages/links gave 404 Not Found. Now managed to get pages to function but all images fail to load, plus links to ...
Jamie's user avatar
  • 1
0 votes
1 answer
89 views

Woocommerce posts and products links works only once and then get 404 error

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error ...
Erfan's user avatar
  • 1
1 vote
1 answer
1k views

Permalinks by page/post name returning 404

All my content is currently setup as pages. I want to setup permalinks with page names. I read some posts online that said choosing %postname% path should render the content. But this does not work. ...
sotn's user avatar
  • 131
0 votes
1 answer
626 views

Custom permalink structure for custom post types including multiple taxonomy

The goal is to have a structure like this: example.com/tax_1/tax_2/post_name This code produces the right structure but the post can't be found (404) // Register custom post types function ...
Axel Murman's user avatar
0 votes
1 answer
50 views

Function to automatically rename the base category permalink

I need a function to paste in my theme that automatically rename the base category permalink from category to genre after activating the theme, example: http://localhost/category/drama/ to http://...
Vincenzo Piromalli's user avatar
0 votes
0 answers
22 views

one url for all pages

Recently I just stocked over something which I can not fix or solve! I like to use a single url like www.mywebsite.com or www.mywebsite.com/something for all my pages. the reason is that I have a ...
Alireza Honarfar's user avatar
2 votes
1 answer
7k views

How to get category URL with the slug?

I have a variable that contains the slug of a category. With that slug I want to create a link to the archive page that displays all the posts in that specific category. What is the best or fastest ...
ralphjsmit's user avatar
0 votes
1 answer
704 views

Set parent for custom post type archive rewrite url

I have 2 custom post types Offices register_post_type('offices', [ 'labels' => [ 'name' => __( 'Offices' ), 'singular_name' => __( '...
S_R's user avatar
  • 163
1 vote
0 answers
17 views

Problem with permalink routing?

I have a post (to keep it simple, "dogs" with content on dogs). The permalink lists my site url and then /dogs. When I edit the post, it is all about dogs. But when I click on the link as ...
Ron Velten's user avatar
1 vote
0 answers
13 views

List / Get post redirects

In WordPress, when I change the slug of one of the posts, WordPress generally is able to automatically redirect it. We're using WordPress as a backend for a SPA, and we aren't able to use these ...
Djave's user avatar
  • 258

1
6 7
8
9 10
64