WordPress Permalink feature alternative
For custom post types, use the post_type_link filter just a you would use the post_link filter for post post type posts
For custom post types, use the post_type_link filter just a you would use the post_link filter for post post type posts
What causes /pages/ to appear in URI? As it turned out, you had a parent page with slug pages. How to remove it? Don’t have a parent page. is there an easy way to prevent child pages from showing the parent page in the URI? This has been asked and answered countless times, for example … Read more
You can use a rule in your .htaccess (a file that will be in the root folder of your WordPress installation) – add this to the very bottom: RewriteEngine On RewriteRule ^/?abc-(.+)/?$ /$1/ [R=301,L]
Ok, resolved it in 404.php <?php $klo_link = $_SERVER[‘REQUEST_URI’]; if (preg_match(“/^\/[a-zA-Z0-9\-\_]+\/$/”, $klo_link)) { //echo “A match was found. \n”; //echo $klo_link; header(“HTTP/1.1 301 Moved Permanently”); header(“Location: “.get_bloginfo(‘url’).”/a”.$klo_link); exit(); }else { get_header(); } Put that at the beginning of the 404.ph
You don’t need a plugin to achieve your goal. Use server redirect in the .htaccess file because it will not load the processor to interpret the WordPress PHP code and will not consume time. The redirect will be completed before the WordPress runs. RewriteRule ^[0-9]+/[0-9]+/(.*)\.html$ /$1 [R=301,L] Where [0-9]+/ is the numeric year and month … Read more
Have you tried to save the permalinks again? Step 1: In the main menu find “Settings > Permalinks”. Step 2: Scroll down if needed and click “Save Changes”. Step 3: Rewrite rules and permalinks are flushed.
Per the Template Hierarchy, creating the file page-tacos.php in your active theme will create the template that would be used to view the page with slug tacos, but it doesn’t create the page. You also need to add the page in WordPress’s backend.
Yes, it is. All you need to do is to install your WordPress on the subdomain, turn the Multisite on and set it to use subdirectories for sites. Make sure the following is set in multisite constants: define( ‘SUBDOMAIN_INSTALL’, false );
There are different filters for the more-link, depending on whether you want it at the end of the_content or the_excerpt. Ultimately both work the same though. Selecting the last three words is a matter of PHP-skills. Like this: add_filter (‘the_content_more_link’,’wpse339250_three_words’,10,2); function wpse339250_three_words ($more_link, $more_link_text) { $excerpt = get_the_excerpt(); // split the excerpt in array of … Read more
How can I customize the output and still keep the permalink editable? The following worked for me: $post_link = home_url( ‘/job/’ . ( $leavename ? ‘%postname%’ : $post->post_name ) . “https://wordpress.stackexchange.com/” ); I.e. If the $leavename is true, use %postname% in the URL. Otherwise, you may then use the actual post name/slug, i.e. the value … Read more