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
- Query posts according to specific post meta values
- list all categories that have a certain word in title
- Variable not staying set
- query statement containing variable won’t execute
- wp_list_pages() refuses to output posts
- List author’s posts with SQL
- Where is the query in wp-login.php
- Can’t seem to do combined query AND sort?
- Order posts by recent comments
- query if page has not child
- Use mysql_query instead of $wpdb query
- How to get events using multiple custom meta fields?
- unable to use ‘new WP_Query’ in AJAX call
- Why my query ‘REPLACE INTO…’ does not work?
- wpdb COALESCE won’t work
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]
- How to list commenters and days since last commented
- get csv of users with user_meta
- WordPress function and string as variable?
- sort query results by newest
- Assign custom parameter to each post in query
- Post with certain term and without any term
- Create a WordPress shortcode using PHP [duplicate]
- Custom Query – Based on user input
- empty query breaks other queries
- How to add div blocks after certain set of post
- How to pass a PHP $_GET variable and fetch/output it?
- Problem in exploding the_content to array
- How to reset usual $query on search page to push custom $wpdb query there?
- Creating WordPress Shortcode with Variable
- get_posts showing only 5 posts. (nopaging and posts_per_page -1 not working)
- Order by meta value pro first then meta value free in my search function
- How to overwrite orderby with add_query_var
- Can’t update multiple rows with $wpdb query
- Custom SQL Query passing array to WHERE p.id
- Order by title – but now built in wordpress func, sort the_title
- Can’t get full post title if there a spaces in title
- Custom Post not working as expected
- How to put a form with php code into a variable or shortcode?
- Restrict query to last day with posts
- Custom query object with Simple-Fields custom date field
- Query does not return content
- Apply class to every third list item? [duplicate]
- Passing a variable from a FOREACH loop in a link
- persist a variable set in header.php all the way down to footer.php
- working with term_relationships table
- Display posts between two particular dates
- pre saved posts query from db options table
- What is wrong with my wp query, cant exclude the category that i want
- Change the destination of the URLs in post.php
- Get access to variable from previous pageview, excluding ajax-calls
- Page with custom template make get request to a custom route – Pseudo code
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Order posts by date, but also give priority for a specific term
- WordPress query undefined offset in loop
- Can I make get_users() query global?
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- $post->ID not working in combination with a custom query
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Get posts from category with custom query
- Insert page content into another page with a changed variable
- get_users with array as meta_value
- Pass Variables or Variable Place-Holder from Editor to PHP
- Issue with custom loop in Archive page
- How to display SQL query that ran in WC_Order_Query?
- Custom Query returns array, but I can’t see it’s elements
- How to access or parse key/values that have “string”
- Custom Post type slider with thumbnail navigation
- Parse error: syntax error, unexpected ‘}’ [closed]
- How to exclude posts for current user
- How to delete all posts, categories and tags from WordPress database
- how to insert missing tags into the posts through mySQL?
- Query posts dynamic date range
- Shortcode to pull posts
- How to read the value of a WordPress $query associative array (hash) key
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- PHP -> SQL Query with Summing
- How to hide posts of a specific custom category in WordPress?
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- Ideas how to search & replace post_content when string contains a newline?
- Related post based on content
- javascript variable to wordpress php variable
- How to insert Collate into WordPress search query?
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- Combine “Exclude” Query in functions.php
- Slow Search Queries – How to exclude pages, media, excerpt, authors, private posts?