Not really a support question, just a way to enhance GP and WPSP π
The set up:
– use a page builder to spiff up a page that will be the “Blog” page, that is, a listing of the blogs, using WPSP shortcode to display them.
– this works fine and dandy π
– however, when a user selects one of those posts to read and then clicks the “Category” link in the single post meta, they are taken to the default archive.php page, which of course does not look as “spiffy” π
The “Fix” (well, for a single category anyway, and the reason for this query)
– copy the GP archive.php file to the GP child theme and then edit as such:
– remove this:
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
… and replace it with this:
<?php echo do_shortcode( '[wp_show_posts id=60]' ); ?>
Works great with a single category. But when is more than one, it would be nice to have a “conditional” in there, such as this pseudo code:
if generate_archive_title = category-one, then do this shortcode
else
if generate_archive_title = category-two, then do that shortcode
… etc.
I only know enough PHP to get me into trouble so if you have a minute to suggest something, it will be greatly appreciated π