Turn query string to sub page

Put this code in your functions.php– function the_dramatist_url_rewrite() { global $wp_rewrite; add_rewrite_tag(‘%sub%’, ‘([^&]+)’); add_rewrite_rule( ‘^events/%year%/%monthnum%/%day%/%postname%/?’, ‘index.php/events/%year%/%monthnum%/%day%/%postname%?sub=$matches[1]’, ‘top’ ); } add_action(‘init’, ‘the_dramatist_url_rewrite’, 10, 0); The go to the permalinks page in the settings menu at dashboard and hit Save Changes button. Hope this is gonna help.

Dequeue script in template isn’t working

Move your project_dequeue_unnecessary_scripts() function to your functions.php file and add a conditional statement to determine if the appropriate template is being loaded. E.g.: // Remove Mobile Header function project_dequeue_unnecessary_scripts() { if ( is_page_template( ‘name-of-template.php’ ) ) { wp_dequeue_script( ‘enterprise-responsive-menu’ ); wp_deregister_script( ‘enterprise-responsive-menu’ ); } } add_action( ‘wp_print_scripts’, ‘project_dequeue_unnecessary_scripts’ ); I suspect that your function is … Read more

Load template file without a post type

You could setup a custom rewrite rule using add_rewrite_rule and send these requests to a custom page. Your URL structure could be /index-page/single-event-slug The rule would point all of the single events to a separate page where you can then set your template events-single.php. Another option is to pass the events in as a query … Read more

Custom Post Type Templates?

First ofcourse we have single-<posttype>.php but I don’t think that’s what you want ( yay if it is ) To implement this, you would need a metabox, with a dropdown that saves the value to a custom field, which you would then pull from in single-<posttype>.php and then use in an include statement. single-.php would … Read more

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