Display list of pages that contain a certain string within the slug
Display list of pages that contain a certain string within the slug
Display list of pages that contain a certain string within the slug
SOLVED: Silly mistake that I made was using wp_query inside the custom metabox output… face palm If you found this post googling the same issue, you need to use a different query method as it conflicts with the page. Using this: $query = get_posts( array( ‘post_type’ => ‘forums’, ‘post_status’ => ‘publish’ ) ); fixed this … Read more
How to create multi-slug admin page and retrieve it with $_GET or something?
My first idea (I’m not sure it’s the most efficient) is to do a redirection in the file category.php or archive.php depending of your theme. Try with this code before the get_header() line : $term = get_queried_object(); if ( (“category” === $term->taxonomy) && (0 !== $term->parent) // if it’s not a 1st level category ) … Read more
Convert slugs on post publish
To Fix it, simply set with_front to false where the custom post types are registered: ‘rewrite’ => array(‘slug’ => ‘portfolio’, ‘with_front’ => false), With this Custom post type will not get 404 error
Allowing slash in slug/permalinks
Use 2 separate post types. It will save confusion now, and provide flexibility later if you decide to do more with each of the posts. There will be a bit more work, but the payout will be worth it. When you’re setting up the CPTs, they will automatically have archive pages and the individual posts … Read more
What happening is that WP is searching for a category rather your post. So the category rewrites come before post rewrites and that is making the WP confused. For more info about the rewrites, I can point you to an excellent article here
You can do this in two ways: (1) with two Pages and a CPT with no archive, or (2) with one Page and a CPT with an archive. Option 1 – two Pages: Create your two regular Pages, with “child-page” set as a child page of “landing-page”. When you register your CPT, set it to … Read more