Text in permalink

There is no template for “/widget”. Templates are about content types and not URL fragments. IMO your page hack is totally legit. Another way to handle this is to have a widgets category which is the parent of all other categories and change your permalink structure to /%category%/%postname%/

WordPress a template for subcategories fo a given category, but not for root category

I managed to solve this in a procedural way: 1 added in theme function this snippet: add_action(‘template_redirect’, ‘load_category_tree_template’); function load_category_tree_template() { if (is_category() && !is_feed()) { // replace ‘your-base-category-slug’ with the slug of root category $base_tree_cat_id = get_cat_id(‘your-base-category-slug’); // get current category id $catid = get_query_var(‘cat’); if (is_category($base_tree_cat_id) || cat_is_ancestor_of($base_tree_cat_id, $catid)) { load_template(STYLESHEETPATH . ‘/category-your-base-category-slug.php’); … Read more

How to make plugin work in each template in wordpress

You would have to put your code in your question into a function. Maybe something like function wpse_91897_get_image() { }. Then try the code below. I haven’t tested this but it should work. function wpse_91897_display($content) { global $single; $output = wpse_91897_get_image(); if (is_single()) { return $content . $output; } else { return $content; } } … Read more

How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?

You should not use a direct SQL query, instead try the WP_Query tax queries e.g.: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => array( 22 ) ), array( ‘taxonomy’ => ‘job’, ‘field’ => ‘name’, ‘terms’ => $terms, ‘operator’ => ‘IN’ ) ) … Read more

Single Post Template with Dropdown Option?

` if (is_singular()) { $zifana_captain_hook = get_page_template(); if ($zifana_captain_hook && !preg_match(‘/page.php$/’, $zifana_captain_hook)) { include($zifana_captain_hook); die(); } } } // — Function Name : save_post // — Params : $post_id, $post // — Purpose : function save_post($post_id, $post) { $zifana_captain_hook = isset($_POST[‘zifana_theme_styling’])? $_POST[‘zifana_theme_styling’] : ”; if ( !empty($zifana_captain_hook) ) { $zifana_captain_hooks = get_page_templates(); $post->page_template = $zifana_captain_hook; … Read more

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