I am presently utilizing a wordpress function to be able to display posts from the specific category. A simplified example is proven below:
<?php query('cat_name=cat1&posts=1') ?>
Basically this will get 1 publish in the category cat1. However I've got a variable saved which will get the present category (this really is on category pages):
<?php $thiscat = get_the_category(); ?> Current Category: <?php echo $thiscat ?>
How do i now echo the variable $thiscat in to the arguments of my query above to ensure that the course title is completed for me personally? This function is used on different category pages so getting it instantly passed towards the arguments of my query saves lots of hassle.
Thanks ahead of time for just about any help.
Unsure I realize the question, however it seems like you need to use $thiscat inside your query. This will get it done:
<?php $thiscat = get_the_category(); query("cat_name=$thiscat&posts=1") ?>
Note the double quotes, that are necessary. If you are using single quotes, the variable won't get broadened.
You simply echo something when you wish to output it towards the browser, ideas concatenate the query string using the variable:
<?php $thiscat = get_the_category(); ?> <?php query('cat_name=' . $thiscat . '&posts=1') ?>