is_category
will not process the logic inside the argument list. This:
is_category('glorkian' || 'glork')
The condition is true on all category pages. What I think is happening is that PHP does parse that argument string, but is always going to be true. Try this:
var_dump('glorkian' || 'glork');
Meaning that what you are doing, essentially, is this:
is_category(true);
That is not a valid argument but the function seems to revert to default functionality– is this a category archive or not? Obviously, the answer is “yes” on any category archive.
Valid arguments are:
(mixed) (optional) Category ID, Category Title, Category Slug or Array
of IDs, names, and slugs.http://codex.wordpress.org/Function_Reference/is_category#Parameters
So I believe that what you need is :
is_category(
array(
'glorkian',
'glork'
)
);
It is the same with has_category
.
Related Posts:
- How can I use a sliced image As banner? [closed]
- How do you remove header sitewide from mobile only?
- PHP unit testing WordPress?
- Proper use of Output Buffer
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Is having multiple theme customizers for different pages possible?
- function_exists call in function.php
- Debugging an error: wp_enqueue_style was called incorrectly
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Creating a WordPress form with a PHP script and default header
- Remove css styles from specific page
- Use different javascript files for each page on website
- How to get custom image size for image uploaded in Customizer
- PHP Customization: Taxonomies and Queries, why? [closed]
- Switching between custom templates in a post type of the admin menu
- Using PHP to toggle stylesheet and header image, set in cookie
- My Own layout in WooCommerce pages [closed]
- Differences when using the the_time and the_date functions
- Custom category code not showing all posts
- Adding country tags automatically
- How do I get current page ID in WordPress customizer file?
- Customizer: Output default value in Customizer CSS
- WordPress does not load page.php, return 404.php
- Add child pages of parent to navbar PHP
- Load a page into a div with Ajax
- Theme Options Page – User Updates Logo
- Converting HTML Template to WordPress Theme
- How to use my style.css file outside of wordpress subdomain?
- Add_action not working in required file of functions.php
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Can’t access variable outside for loop
- add custom link to wordpress media gallery modal
- Improve page speed loading using CDN and async or defer attribute
- Populate editor with some content of a page with a page template
- Two queries for a WP_User_Query search work perfectly apart, but not together
- Displaying recent posts on static page with template-part via shortcode
- How to edit widget code to add unique class name to each div?
- Skt full width basic slideshow problem
- Insert custom PHP head above in WP pages
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Does wordpress templates always in files or in database?
- get_template_part for specific page
- How do I create my own .php file with a code part and echo it on different pages?
- WordPress admin-ajax.php
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Royalty-Free Sliders used in theme development
- Having Issue on Redirecting With Session in WordPress
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- get_template_part() not firing within a switch statement when template has new WP_Query
- How to call multiple functions from multiple files into a WordPress page template [closed]
- linking stylesheets and scripts with functions.php
- zip unzip attachments in wordpress
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- WordPress get_media_embedded
- What is the best way to define constant options for a theme?
- Warning: printf(): Too few arguments in helpers.php file
- Help Fallback (thumbnail)
- get_comments_number() returns 0
- get_page_templates only return templates with “home” in the filename
- Show different website layout if no sidebar added
- Why the dynamic_sidebar() call is putted into an ul tag?
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- Toolbar Hidden in a Virtual Page
- Custom functions for string data calculations
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Header is not displaying on certain pages of wordpress theme [closed]
- Reliable way to add nonce to HTTP Header in WordPress?
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- Display values of current POST request on page
- How to change PHP variables with AJAX request in WordPress
- REST API custom endpoint to fetch pages and posts not working
- Looping through dummy posts and showing them in the main index.php
- Exclude category from woocommerce product category list
- Trying to get pagination working on WP_Query() post grid
- Warning: count(): syntax problem of the count () function
- Fix hover images blink
- Customizer: How to Sanitize a Decimal Number Range
- PHP code printed into CSS classes
- Get the image title and alt from custom query
- What syntax is this? “{{post.price}}”
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- Problems with the WordPress loop [closed]
- Calling PHP function doesn’t work in index.php
- WordPress get_post_meta issue
- How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can’t add a featured immage?
- How to add button to top of theme customizer?
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- Sidebar doesnt get updated?
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Predefine Magazine Style Layouts
- Twig+WordPress how to use array arguments inside a function?
- How to store the_post_thumbnail() value in a variable
- Dynamic Email Handler with ‘header (“Location: …’
- Variable ++ in query loop
- functions.php doesn’t load all custom theme assets