How is a URL getting mapped to a page template

I have done something similar by adding a rewrite rule add_rewrite_rule( “users”, “index.php?fea_users”, ‘top’); add_filter( ‘query_vars’, array($this, ‘query_vars’) ); add_filter( ‘template_include’, array($this, ‘template_include’), 1, 1 ); function query_vars( $query_vars ) { $query_vars[] = “fea_users”; return $query_vars; } function template_include( $template ) { global $wp_query; if ( isset($wp_query->query[“fea_users”]) ) { // return any php file here … Read more

Why is there a # and other characters in URL for WordPress site?

Check your database,maybe you’re hacked. Here what must be searched: wp_options,this is the name the wordpress option,the second record is your blog_name. (If you’re new bie in porgraming and/or wordpress here the steps: 1.Go to cpanel(on your hosting): 2.Search for “phpMyAdmin”and select it 3. Must be find your wordpress database, if you’re lucky the name … Read more

WooCommerce product permalinks

Add a filter for post_type_link, and change its value in a callback function. Sample code, not tested: add_filter( ‘post_type_link’, ‘simple_woo_urls’, 10, 2 ); function simple_woo_urls( $url, $post ) { if ( ‘product’ === $post->post_type ) return home_url( $post->post_name ); return $url; }

Losing the original URL when using add_rewrite_rule

wow, after more banging of my head against the wall, it took this: add_rewrite_rule(‘work/all/([^/]*)/([^/]*)/?’, ‘index.php?post_type=project&name=$matches[2]&mode=all’, ‘top’); Two things actually, I had to include a post_type=project part as well as change pagename to name. If I remove either one, I get my previous results. I am not sure why this set of values works when other … Read more

Update permalinks

You can try switching to basic permalink structure (the one with post id format) and then again choose custom permalink. Or you can use following plugin to write desired URL for each page Custom Permalink Plugin

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