Dynamically link to most recent post in a category
-
Hello friends :) I am in a pickle. I am creating a website in X/Cornerstone for an artist who has many projects , each has of which has its own WordPress site. All of them rely on blog posts to provide recent content. We’re migrating all of them to this same site. We are assigning each WP site into a category on this site. Each category has a link on the homepage.
I need to make these links (for example, dwicefox.com/categories/artandwit) go directly to the most recent post. I don’t want this to be the category archive, only showing one post (I could settle for this, but for some reason I can’t get the images (which are basically the whole content) to show up beneath the titles – whole other issue lol). Besides, I don’t want to settle for what seems like it should be a simple solution.
I have found many posts online with this same question, with many custom PHP solution, but none of the solutions work. The Functions.php keeps breaking with any PHP I place in there, and others suggest I edit categories.php or archives.php, but I don’t have either of those. At least not in the theme options? I’m not sure if the PHP I’m trying isn’t working because they are all 5 or 6 years old, or if it’s just because they’re not compatible with the Cornerstone theme. Can anyone help please?? :) Thanks so much!!!
-
These forums are for sites hosted on WordPress.com, but your site is self-hosted, running the WordPress software on your own hosting.
You can get help by posting your question in the WordPress.org forums for self-hosted sites:
https://wordpress.org/support/
You’ll need a free WordPress.org account to post – if you don’t already have one, you can register here:
https://wordpress.org/support/register.php
If possible, be sure to provide a link to your site when you post so people can help you more easily.
- The topic ‘Dynamically link to most recent post in a category’ is closed to new replies.