Issue with archives.php
-
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 17We 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!
- The topic ‘Issue with archives.php’ is closed to new replies.