How to create default categories in new installs?
How to create default categories in new installs?
How to create default categories in new installs?
You need to create a page of post. It is quick and very easy HERE IS HOW STEP 1 Copy your page.php template and rename it to something like page-pop.php STEP 2 Open up the template and add the following header right at the top to tell wordpress it is a page template <?php /** … Read more
There is a conflict with the taxonomy slug and custom-post-type slug. You are keeping both same. There are two options: 1) Either remove the rewrite => $rewrite from the taxonomy array and make it like this $labels = array( ‘name’ => _x( ‘Portfolio Categories’, ‘Taxonomy General Name’, ‘owd’ ), ‘singular_name’ => _x( ‘Portfolio Category’, ‘Taxonomy … Read more
What @ChipBennett meant is to show the actual code that is represented by the shortcode, it can be found in the source. Take a look at this to see what’s behind it – it is a WP_Query. Aside from that, the problem is – as far as I can tell – that you’re misinterpreting what … Read more
Heree’s a code solution, not htaccess. This first checks if current query is for a category page, then checks category existence, and if category not exists but a tag with the same name, it redirects to the tag page. add_action(‘parse_request’, ‘wpse_parse_request’); function wpse_parse_request( $r ){ if( isset($r->query_vars[‘category_name’]) ) { $cat = get_term_by(‘slug’, $r->query_vars[‘category_name’], ‘category’); if( … Read more
Depends on what you want to do but most of the time to target blog page you will have to use : if( is_home() || is_front_page() ) I know this could be a little bit confusing but check this link. !is_home() might be the condition you’re looking for.
Yes, there is probably a way to do this but it is going to be theme/plugin dependent. Without knowing the details I don’t think a good answer is possible. However, there are a couple of general case solutions. The first is to add your callback on a hook that runs after the breadcrumb code. function … Read more
Off the top of my head, you can achieve the desired effect in two different ways. Extend the Category Walker Extend the Walker_Category() class and overwrite the start_el() method with similar code that retrieves a list of posts in the category being processed and displays them in an unordered list within the category’s <li> element. … Read more
A filter on pre_get_posts should do it. function hide_author_wpse_138491($qry) { $exc = 123; if ( !is_admin() && !is_singular() ) { $qry->set(‘author’,’-‘.$exc); } } add_action(‘pre_get_posts’,’hide_author_wpse_138491′); This should exclude results from the author with ID = 123 on all front end pages except for “single” pages, which sound like what you are aiming for– ie, to “completely … Read more
The best method is to find another way to structure your URLs that doesn’t break unique slugs. Even though you may not have any plans to do so now, you may need to change the URL structure of the site down the road in such a way that having duplicate slugs would break the site. … Read more