I’ve been trying to figure out how to display full posts on the home page, and excerpts on all archives for about 3 days. This is nice because it means a decent amount of each post is shown on the front page, whilst archive pages contain a much more concise summary of each post. This is better both for humans, and also for یہ — my archive pages now don’t have duplicate content from my home page!
I’ve finally produced a solution. It’s not especially elegant, but I’ve been at the very limit of my پی ایچ پی knowledge just to achieve this method. This applies specifically to the Mystique 3 موضوع, other themes are likely to vary, although some of this information may or may not prove relevant. If you are trying or succeed in doing the same to a different theme do drop a comment in.
How it currently works
Mystique has options which allow the admin to choose whether to display excerpts or full posts. This option is stored as $post_content_mode inside the $options array.
The file archive.php displays the archive and displays each post in a loop via teaser.php
teaser.php has the line
[پی ایچ پی]<?پی ایچ پی (is_sticky() && is_home()) ? the_content() : $app->post->مواد(); ?>[/پی ایچ پی]
This line generates the content via a call to the function getContent in the file AtomObjectPost.php. If this line is commented the post contents disappear from archive pages.
The getContent function loads $options and as a results either calls the_content() or the_excerpt() which are wordpress built-in functions.
حل
I’ve managed to achieve what I wish by modifying teaser.php — but its a bit of a botch job I think. I just replaced
[پی ایچ پی]<?پی ایچ پی (is_sticky() && is_home()) ? the_content() : $app->post->مواد(); ?>[/پی ایچ پی]
کے ساتھ
[پی ایچ پی]<?php if(is_home()): ?>
<?پی ایچ پی (is_sticky() && is_home()) ? the_content() : $app->post->مواد(); ?>
<?php else: ?>
<?پی ایچ پی (is_sticky() && is_home()) ? the_excerpt() : $app->post->مواد(‘e’); ?>
<?php endif; ?>[/پی ایچ پی]
A better solution?
I would rather implement this solution via an addition to functions.php but I have no idea how to do so. My پی ایچ پی knowledge just isn’t good enough.
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”