Okay, I’ve managed to get this to correctly do categories, but not tags. Here is the code I’m using. Can anyone tell me how to fix this so it will work with both categories and tags?
I just used the same code for the category, subbing in tag, but it’s not working, so it must need to be different.
Thanks for any help. I really don’t know PHP at all – this is just me chimping.
`<?php if (function_exists(‘fpg_show’)) {
$args = array_merge( $wp_query->query, array( ‘showposts’ => ”, ‘category__in’ => array(get_query_var(‘cat’)) ) );
echo fpg_show($args);
}?>
<?php if (function_exists(‘fpg_show’)) {
$args = array_merge( $wp_query->query, array( ‘showposts’ => ”, ‘tag__in’ => array(get_query_var(‘tag’)) ) );
echo fpg_show($args);
}?>
Got it! Here is the final code, if anyone else wants to do this. This produces a grid style archives page for any category or tag that is clicked:
<?php if (function_exists('fpg_show')) {
$args = array_merge( $wp_query->query, array( 'orderby' => 'title', 'order' => 'ASC', 'showposts' => '', 'category__in' => array(get_query_var('cat')) ) );
echo fpg_show($args);
}?>
<?php if (function_exists('fpg_show')) {
$args = array_merge( $wp_query->query, array( 'orderby' => 'title', 'order' => 'ASC', 'showposts' => '', 'tag__in' => get_query_var('posttag') ) );
echo fpg_show($args);
}?>
I have a reverse problem. I only want it on my homepage and not in categories and tag pages. How would I do this? I no nothing about coding sorry :)I installed it in my homepage theme file and it shows up everywhere.
I am trying to display a select group of posts on one specific page using short code. I’ve tried placing code in various places and still get error message below.
————————————————-
page.php (code below)
<?php
/**
* @package WordPress
* @subpackage KidsToys
*/
$from=’page’;
include(“layout.php”);
}?>
<?php if (function_exists(‘fpg_show’)) {
$args = array(
‘cat’ => ‘8’,/* comma separated list of category ids to include (put ‘-‘ in front of ids to exclude) */
‘tag’ => ‘discount-directory’ /* comma separated list tag slugs to include */);
echo fpg_show($args);
}?>
—————————————————
Result: (Error below)
Parse error: syntax error, unexpected ‘}’ in /homepages/12/d154028271/htdocs/tallahasseekidsclub.com/wp-content/themes/kids_toys/page.php on line 12
—————————————————–
Any advice