Can someone tell me what the PHP would look like in order to get a category from WordPress and then print it where ever I want?
I’m guessing I have to build a PHP function. Something like:
function get_a_category() {
$category = get_the_category(); <—–( not sure how to ge ta specific category )
echo $category;
}
I have no idea I know nothing about PHP
can someone help me please ?
You don’t have to write your own function; you do have to work with the The Loop (WordPress Codex) and a new query (Function Reference/query posts « WordPress Codex) to keep the original WP loop in place. Run this new query in a page template to get the first post from “mycategory”. Change showposts to the number of posts you want.
Try this