Custom Post Type Advanced Slug

This is pretty straightforward using a rewrite endpoint. The first step is to set an ep_mask when you register your taxonomy, which is part of the rewrite argument. Note that it’s a constant, and should be as-is, without quotes: $args = array( ‘rewrite’ => array( ‘slug’ => ‘location’, ‘with_front’ => false, ‘ep_mask’ => EP_TAGS ), … Read more

Edit the post title from the frontend

Yes, you can change post title and slug from frontend. by using wp_update_post you can change title and slug of post. in below code, it will update post title and slug of post_id. Replace your-post-title-field with your title field in form. slug will generated using that post title. if ( isset( $_POST[‘my_image_upload_nonce’], $_POST[‘post_id’] ) && … Read more

Replace image name on upload to the new post name on front-end form

You can use sanitize_file_name filter to rename file. put this code in active theme’s functions.php, this will rename image filename as postname if only get title request. I have tested this code and it is working fine. Post name : https://prnt.sc/q3thzw Uploaded renamed image : https://prnt.sc/q3tib7 function make_filename_as_post_name($filename) { $info = pathinfo($filename); $ext = empty($info[‘extension’]) … Read more

my post slug gets really long and I can’t change it

This is because you’re using characters that aren’t valid in URLs: קידום-מנצח URLs only allow a limited subset of ASCII characters In order for these characters to work in a URL, they have to be encoded. For example if I visit example.com/foo bar/ the space isn’t valid in URLs, so it gets turned into example.com/foo%20bar/, … Read more

Adding language based URL structure

If you’re talking about pages, you can create a parent page with the country code as it’s URL and set all the other pages as children of it. You could even make that page the homepage for that language. If you mean posts, you could create a custom taxonomy and follow these instructions to add … Read more

A way to export slug as meta tag

I don’t think there is a built-in mechanism to write meta tags, no: you have to echo it from a wp_head hook. For example: function slug_meta_tag() { if ( is_single() ) { global $post; if ( $post && $post->post_name ) { echo ‘<meta name=”slug” content=”‘ . esc_html( $post->post_name ) . ‘” />’; } } } … Read more

page-slug.php not working but only for specific slug

I thought it might be conflicting with something I had in functions.php, however nothing else was using the name “comics” There is, here: // Arguments $args = array( ‘labels’ => $labels, ‘public’ => true, ‘menu_icon’ => ‘dashicons-book-alt’, ‘hierarchical’ => true, ‘exclude_from_search’ => false, ‘has_archive’ => true, ‘publicly_queryable’ => true, ‘rewrite’ => array( ‘slug’ => ‘comics’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)