Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:36:53+00:00 2026-06-02T12:36:53+00:00

I am modifying a WordPress plugin / widget. It is a category-post plugin where

  • 0

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 &raquo;</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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:36:54+00:00Added an answer on June 2, 2026 at 12:36 pm

    To expand on my comment, try this:

    $category = get_the_category(); 
    if($category[0]){
        echo '<p class="read-more-custom-widget">';
        echo '<a href="'.get_category_link($category[0]->term_id ).'"title="Read More">Read More &raquo;</a>';
        echo '</p>';
    }
    

    Adapted from the WP docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Without modifying the form itself, can we make the from only show for some
I'm interested in modifying a template in a wordpress install to show related posts
I am working on modifying a plugin for wordpress to better suit my needs,
I asked How can I make the Preview Post button save and preview in
I am modifying a wordpress theme completely, and have run into one very simple
I am modifying a website on wordpress (codex) and I would like to import
I am modifying my PHP network's code to have user roles like wordpress here
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I am looking at modifying a jQuery Plugin to cater for an additional requirement
I need some help modifying the Webform Module so that it can work for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.