Permalinks, Rewrites, Get Variables, Oh My!

I’m not sure but I think that you just need to add two query vars, “group” and “value”, not two rewrite tags. Can you try this: add_filter(‘query_vars’, ‘cyb_add_query_vars’); function cyb_add_query_vars( $vars) { $vars[] = “group”; // name of the var as seen in the query string and URL $vars[] = “value”; return $vars; } add_action(‘init’,’cyb_add_rewrite_rules’); … Read more

Custom url for a single page

Read on htaccess. You can try this, <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^phones$ /?page_id=1081 [L] </IfModule>

Make attachment pages require a base url

Endpoints are for adding extra query vars to existing routes, I think you just want a vanilla rewrite rule here: function wpd_media_image_rewrite_rule() { add_rewrite_rule( ‘^image/([^/]*)/?’, ‘index.php?post_type=attachment&name=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘wpd_media_image_rewrite_rule’ ); You might want to loop over valid mime-types there and add a rule for each. You also need to flush rewrites for … Read more

Child pages with same slug

In terms of being able to create that URL structure, it is definitely possible. If you are assigning those pages to a parent, it will allow you to have the same slug, as long as they all have different parents. I would definitely recommend that they don’t have the same content on each though, as … Read more

Create slugs programmatically

You need to programmatically set the slug as you do so. An SQL trigger could do the trick. Don’t forget to mind duplicate slugs as you write it. Else, instead of publishing using the database, write a php script that calls the WP API.

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