I am modifying a WordPress plugin / widget. It is a category-post plugin where we can display posts from a specific category. I am trying to make the widget to show only one post (easy) and then I add a “Read More” button at the bottom. But, instead of showing the rest of the post (they are short posts, like quotes for example) I want “Read More” to take the user to the respective category page.
So far the best I can do is:
<p class="read-more-custom-widget"><?php echo '<a href="'.get_the_category().'" title="Read More">Read More »</a>';?></p>
but this displays Array instead of the category. Can anyone please help me?
Thanks in advance.
EDIT: The posts will only have one category. Sorry this is so simple (and I bet it is) but I have googled around and can’t find the answer.
To expand on my comment, try this:
Adapted from the WP docs.