use the indentical comparison operator:
if(get_query_var('cls') !== '' && get_query_var('ch') !== '') {
mcs_textbook_chapter($dialect, $cls, $ch);
} elseif(get_query_var('cls') !== '') {
mcs_textbook_chapter($dialect, $cls);
} else {
mcs_textbook($dialect);
}
Related Posts:
- Using WordPress public query variables
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- MySQL variable in query
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Nested loop : wich way/order?
- Passing parameters to a static front page
- Query posts based on previous query
- Advanced Custom Fields – Relationship post foreach query
- Declaring a var, placing it in a query and using the output of the query?
- WordPress is removing query variables like page, p from the URL of a custom static page
- Not getting input from get_query_var
- WordPress: paginating array using a foreach
- “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP
- Custom query_var causes displaying posts archive on front page
- What is the most efficient way of implementing a favorite post system?
- Query by one meta_key and sort by another (possibly NULL value)
- Query & Sort Comments by custom comment meta
- How to order posts by modified date without using ‘query_posts’?
- is_archive() doesn’t work on public query var archive pages?
- Specific Loop For 2 Within Each
- Inserting data into `post meta` table?
- search through post-type attachments titles
- cron job to auto delete posts of a specific post type older than x days
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- Most effective use of DB querys
- Get ID of child from child slug, while knowing parent ID
- Two differents queries in archive page
- How do I find if a page has a template?
- How to set back query var author_name after unset it?
- My SQL function to change user_name
- How to retrieve elements from another table in a SQL query?
- Putting PHP variables into javascript [duplicate]
- WordPress Loop: List All Posts by a Category & Subcategory
- Why is variable not working on custom sql query using wpdb?
- Variable global scope [closed]
- Custom filter in admin edit custom post type responding with invalid post type?
- Static variable and add_rewrite_rule?
- only delete post within query / for each statement (front end)
- List all posts from past week grouped by sub-category
- Query Custom Post Type posts by Keyword/url slug
- how would I create a custom query to get all users, and a related post based on a postmeta field?
- Display posts with a start OR end date later than current date
- Order posts by custom field DATE value
- Pass variable from one function to another
- creat filter with wp_query
- Increase offset while looping
- Form redirect with query vars to page
- Query to Get All Users from wp_users With NO matching user_id In wp_usermeta
- Two queries for a WP_User_Query search work perfectly apart, but not together
- WordPress custom setting page – add flashing message
- Custom query AFTER rss fetch_feed not working
- Multiple Category Query
- list all categories that have a certain word in title
- sort query results by newest
- How to pass a PHP $_GET variable and fetch/output it?
- How to reset usual $query on search page to push custom $wpdb query there?
- Order by meta value pro first then meta value free in my search function
- How to overwrite orderby with add_query_var
- Custom Post not working as expected
- persist a variable set in header.php all the way down to footer.php
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- How to delete all posts, categories and tags from WordPress database
- Ideas how to search & replace post_content when string contains a newline?
- Query the WordPress database to get data together with replaced information
- How to reference PHP in Javascript
- $wpdb->prepare affecting the query?
- WordPress SQL search, how to handle SQL Injection?
- echo var into wp_query
- Query for Custom Post Type UI Does Not Loop All the Post
- Querying for specific tags
- Limit tags shown in post
- Passing PHP Variables to AJAX Loaded Pages
- How to manage a particular “order by” for get_search_query()?
- Query to view scheduled or draft post
- How to add a Variable to post query
- Build A Custom SQL Query for WordPress Search
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- Reading URL Parameters
- How to display variables from plugin?
- Trouble migrating custom post types from non-wordpress cms
- How to do a MySql query in WordPress?
- Pagination in WP Queries
- “order” does not affect order of custom query
- Create a new post on a specified publish date via link?
- Exclude Posts from a Widget
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- Query String for the WP_QUERY parameters
- $wpdb query for price in custom field value
- Custom Taxonomy Link Text Echo Name Not Slug
- Multiple terms not working on taxonomy
- Sorting of coupons in the right way
- Unserializeing multiple column values that are stored in one database results variable
- excludeCat function reverses order of blog posts
- Run search query again without pagination gives no results?
- If Elseif Query
- How can I add more code to this?
- WP_Query orderby meta key/value suddely stopped working
- Does wp_query and query_posts affect website performance? [duplicate]
- WooCommerce Total # orders [closed]
- How to show sticky posts on all pages of the pagination, not just the first page?