justbishop
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Categories in Grid View on PageWell, compared to me, yes! Seriously, though…I have about $5 in my Paypal account. It’s yours if you’d like it (hey, it’ll almost buy you lunch at McD’s, right?) ??
Forum: Themes and Templates
In reply to: Categories in Grid View on PageYou are a PHP god.
*bows down to*
I’m doing this for a client site, but it’s a trade for custom cloth diapers, or I’d Paypal you part of the money, lol!
Forum: Themes and Templates
In reply to: Categories in Grid View on PageNevermind, I did it using THIS link instead!! I’ve got my categories auto-displaying with scaled down category representative pix! I know it’s silly but I’m pretty d*mn proud of myself ??
And thanks again for the help, MichaelH!!
However, I have a new issue…I want a grid display, 4 columns across and a dynamic amount of rows, depending on how many categories are added in the future. I figured a straight HTML table would be the way to go here (rather than a ton of complicated CSS), but am REALLY lost on how to get the code to only display 4 cells across and then add a new row. Right now I’ve got 5 test categories set up, and they’re all displaying on the same row together. Here’s my template code for retrieving the categories. I know it’s silly and wrong, but I just don’t know where to go from here:
<table border="0" width="100%"> <?php $categories = get_categories('hide_empty=0'); echo '<tr>'; foreach ($categories as $cat) { echo "<td width=\"25%\" align=\"center\"><a href=\"" . get_category_link( $cat->term_id ) . "\"><div class=\"description\"><img src=\"wp-content/uploads/". $cat->description .".jpg\" width=\"100px\"></div>" . $cat->cat_name . "</a></td>"; } echo '<tr>'; ?> </table>
Forum: Themes and Templates
In reply to: Categories in Grid View on PageOk, here’s what I put in a file I created called “my-hacks.php” and uploaded to my root WP folder (are the php open/close tags right??):
<?php function category_images($seperator = '', $image_type = 'jpg', $image_directory = '/wp-content/uploads/') { $categories = get_categories(); $image_directory = preg_replace('|/+$|', '', $image_directory); if ('' == $seperator) { echo '<span>'; foreach ($categories as $category) { $category->cat_name = stripslashes($category->cat_name); echo "<a href='" . get_category_link(0, $category->category_id, $category->category_nicename) . "' title='View all posts in $category->cat_name'><img src='$image_directory/$category->category_nicename.$image_type' alt='$category->cat_name' /></a>"; } echo "\n</span>"; } else { $i = 0; foreach ($categories as $category) { $category->cat_name = stripslashes($category->cat_name); if (0 < $i) echo $seperator . ' '; echo "<a href='" . get_category_link(0, $category->category_id, $category->category_nicename) . "' title='View all posts in $category->cat_name'><img src='$image_directory/$category->category_nicename.$image_type' alt='$category->cat_name' /></a>"; } ++$i; } } ?>
And here’s the template tag I added to a new page template:
<?php category_images(' '); ?>
And here’s the error it gives me:
“Fatal error: Call to undefined function category_images() in /home/*******/public_html/knitsandwhatknot/wp-content/themes/fixed-blix/shop.php on line 21”
I’m lost ??
Forum: Themes and Templates
In reply to: Categories in Grid View on PageThanks for the help so far! I really do appreciate it ??
I’m a php doofus, so please bear with me…THIS is looking like it may be the way to go, but I just want to make sure that I’m on the right track.
So I’d just make a file called “my-hacks.php” and paste the following into it (and of course the template tag into my page template used to display the category grid)? I’ve made the “get_categories” change as well as the folder I’d like it to pull images from and the file extention (to jpg). Please advise if this is incorrect:
function category_images($seperator = '', $image_type = 'jpg', $image_directory = '/wp-content/uploads/') { $categories = get_categories(); $image_directory = preg_replace('|/+$|', '', $image_directory); if ('' == $seperator) { echo '<span>'; foreach ($categories as $category) { $category->cat_name = stripslashes($category->cat_name); echo "<a href='" . get_category_link(0, $category->category_id, $category->category_nicename) . "' title='View all posts in $category->cat_name'><img src='$image_directory/$category->category_nicename.$image_type' alt='$category->cat_name' /></a>"; } echo "\n</span>"; } else { $i = 0; foreach ($categories as $category) { $category->cat_name = stripslashes($category->cat_name); if (0 < $i) echo $seperator . ' '; echo "<a href='" . get_category_link(0, $category->category_id, $category->category_nicename) . "' title='View all posts in $category->cat_name'><img src='$image_directory/$category->category_nicename.$image_type' alt='$category->cat_name' /></a>"; } ++$i; } }
Forum: Themes and Templates
In reply to: Categories in Grid View on PageThanks again…I’ll have to play with the Category Image(s) plugin later tonight to see what I can make of that. The rest of the info linked seems to be focused more on displaying an image that represents a category with a post (or do they mean any category that CONTAINS a post??)
Forum: Themes and Templates
In reply to: Categories in Grid View on PageAh, I hadn’t thought to use the term “columns”, thanks ??
Thanks for the Google, but unless I’m missing something (which is entirely possible), everything there is still about displaying categories as list items. I’d actually like to strip the list styling, add an image to represent each category, and display them 3 or 4 across :/
Forum: Themes and Templates
In reply to: Categories in Grid View on PageThank you ??
Anyone else know if the wp_list_categories template tag can be made to do something like this?
Forum: Themes and Templates
In reply to: Categories in Grid View on PageThanks, but I need to use the theme I’m using ??
Forum: Themes and Templates
In reply to: Categories in Grid View on PageNo, that’s not part of my theme, hence me asking. I was just assuming that there would be some sort of template tag that might be able to be rigged for this involving wp_list_categories.
Forum: Your WordPress
In reply to: My New WP Site, any feedback is appreciatedI assume that you’re going for the minimalist look and all, but I thought the headings needed something to make them seem more important to the eye. The stuff in the sidebar just looks like one big clump of text and was hard to read because it was all kinda the same tone, and the post titles in the content area just seem like they’re floating around in there.
I like your header, though ??
Forum: Plugins
In reply to: Category Template PluginCan you not just create new template pages and ftp them to your theme folder? I do that all the time with the Blix theme (forgive me if it works differently with different themes).
You just name them according to category ID# (i.e. category-2.php for the template you’d like used for the category with the ID# 2).
Forum: Everything else WordPress
In reply to: How to Contact a Moderator Here?Thank you!
Forum: Plugins
In reply to: Notify Contributor When Published Post is Demoted to DraftJust to clarify, I’m wondering if it would be pretty simple (and if someone could help me, since I’m not proficient with writing PHP) to modify the Draft Notifier plugin to send it’s emails in the opposite direction (to Contributor, rather than admin) any time something is marked with “draft” status.
Forum: Everything else WordPress
In reply to: How to Contact a Moderator Here?Just because I don’t want to annoy anyone further, it’s ok if I re-post the added info/clarification that was removed earlier then? I was fine with it being removed and was just going to edit the original post with less confusing wording :/