Forums

Issue with archives.php (4 posts)

  1. acheashadow
    Member
    Posted 1 year ago #

    Hi all,

    I'm having a problem with archives.php in my template folder, I have created a theme for a friend and I'm using archives.php for categories and using this code in the H3...

    <h3>LATEST <?php echo get_the_category_by_ID($cat); ?> ON CONSOLE OBSESSION</h3>

    This works fine but when someone clicks on the authors name in the post we get this error code:

    LATEST
    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/console/public_html/wp-content/themes/console-obsession/archive.php on line 17

    We know that it relates to the code I put in above, is there anyway I can do an if statement so if its a cat page it echos the cat name and if its an author page it echos the authors name?

    Many thanks in advance!

  2. acheashadow
    Member
    Posted 1 year ago #

    Anyone?

  3. acheashadow
    Member
    Posted 1 year ago #

    Someone please help!

  4. acheashadow
    Member
    Posted 1 year ago #

    Someone must know how to fix this!!!!

Topic Closed

This topic has been closed to new replies.

About this Topic