Community Forums › Forums › Archived Forums › Design Tips and Tricks › customizing category pages
Tagged: category, category pages, customize, generate, greenecon
- This topic has 8 replies, 2 voices, and was last updated 11 years, 8 months ago by Brad Dalton.
-
AuthorPosts
-
March 18, 2013 at 5:33 pm #29213greeneconMember
I want to use wp-tiles for category pages. Totally confused on how to do this. Not sure where to put the code they recommend. Looked all over Word Press and Studio Press. Can't imagine Im the first person to want a custom category page! Below's the code they recommend: (where does it go?) The short code we are using on pages is:
[wp-tiles Template=TGE posts_query='category=328'] Where template is one we set up. then we pick the category. Worst case we can make a bunch of pages with the code for the category and then make menus to link the pages. Looked to see if I could put this short code into genesis simple hooks but couldn't find one that looked like it was about the category pages. Any ideas? We use genesis and generate. Here's and example of what the pages look like: http://www.thegreeneconomy.com/home/testv1/
<?php get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main"><?php if ( function_exists ( 'the_wp_tiles' ) ) the_wp_tiles(); ?>
</div><!-- #content -->
</section><!-- #primary --><?php get_sidebar(); ?>
<?php get_footer(); ?>March 19, 2013 at 12:09 am #29316Brad DaltonParticipantWhat you'll need to do is add this code to a custom function which includes a conditional tag for your category archive pages.
if ( function_exists ( 'the_wp_tiles' ) ) the_wp_tiles();
Use the conditional tag for category pages, is_category() http://codex.wordpress.org/Conditional_Tags#A_Category_Page
There's no template files for category pages in the child theme which is better because you need to use custom functions.
March 26, 2013 at 7:24 am #31295greeneconMemberThis is what I understand from what you wrote.
I put in my functions.php
if
( function_exists (
'the_wp_tiles'
) ) the_wp_tiles();
Not sure where the following goes: 'Use the conditional tag for category pages, is_category()'
I am thinking this goes on the category page somewhere, so would be 'is_category(12)' for our news category. Since we want to use on many category pages, do we customize each? Thanks. t.
March 26, 2013 at 7:45 am #31302Brad DaltonParticipantI don't think that code will work.
I would ask the plugin developer for the code which works with Genesis child themes functions.php file as there are NO template files you can paste the line of PHP into.
March 26, 2013 at 10:56 am #31341greeneconMemberTotally confused. I was trying to understand what you recommended. Are you suggesting that what you thought would work won't work? Or that I totally misunderstood what to do with the information you provided.
Your info below:::::::::
What you’ll need to do is add this code to a custom function which includes a conditional tag for your category archive pages.
if
( function_exists (
'the_wp_tiles'
) ) the_wp_tiles();
Use the conditional tag for category pages, is_category() http://codex.wordpress.org/Conditional_Tags#A_Category_Page
There’s no template files for category pages in the child theme which is better because you need to use custom functions.
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.March 26, 2013 at 11:51 am #31357Brad DaltonParticipantYou'll need a custom function written to run the PHP function for the plugin you want to use to style your category archives page. The function will need a conditional tag so it only executes on the pages you want it to.
Sorry but i cannot read the code very well when its not pasted correctly. Please use the PHP opening and closing shortcodes when pasting PHP code in posts. Learn more about FAQ No.5
That code won't work unless it a added to a custom function correctly.
What i suggest you do is ask the plugin devloper for tha custom function which works in your child themes functions.php file because your theme doesn't use category archive templates.
When you get that from them, i'll write it into a cutsom function with conditional tag for you so its works on your theme.
March 26, 2013 at 12:12 pm #31366Brad DaltonParticipantAnother option is to use the shortcode in a custom function.
Here's a sample of what the code will look like https://gist.github.com/braddalton/5247701
You can change the conditional tag, add category i.d's to the conditioinal tag and change the Genesis hook location.
March 27, 2013 at 3:36 pm #31605greeneconMemberI apologize for being such a git, but I"m not sure what you think I should do with this code. [pardon the language].
Simple hooks has a section that seems like it would be a good place to place your code, but not sure what part of the code to put. [image below]. Assuming if this was the right to code to put here, then we'd just check the 'execute shortcodes' , but not php one.
We put in in our test site functions.php. It didn't break the site, but wp-tiles isn't working there anyway. We have little to no content which I am assuming is the problem and trying to fix that. Anyway, where does this code go? Tana
March 28, 2013 at 12:24 am #31681Brad DaltonParticipantPaste it at the end of your child themes functions.php file.
This is sample code which needs to be modified:
What i suggest you do is ask the plugin developer for the custom function which works in your child themes functions.php file because your theme doesn’t use category archive templates. ref
I would not use a plugin if its not well supported and cannot communicate with the developer.
Have you seen this plugin?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.