Forum Replies Created

Viewing 15 replies - 406 through 420 (of 445 total)
  • Thread Starter justbishop

    (@justbishop)

    Well, 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?) ??

    Thread Starter justbishop

    (@justbishop)

    You 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!

    Thread Starter justbishop

    (@justbishop)

    Nevermind, 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>
    Thread Starter justbishop

    (@justbishop)

    Ok, 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 ??

    Thread Starter justbishop

    (@justbishop)

    Thanks 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;
            }
    }
    Thread Starter justbishop

    (@justbishop)

    Thanks 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??)

    Thread Starter justbishop

    (@justbishop)

    Ah, 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 :/

    Thread Starter justbishop

    (@justbishop)

    Thank you ??

    Anyone else know if the wp_list_categories template tag can be made to do something like this?

    Thread Starter justbishop

    (@justbishop)

    Thanks, but I need to use the theme I’m using ??

    Thread Starter justbishop

    (@justbishop)

    No, 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.

    I 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 Plugin

    Can 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).

    Thread Starter justbishop

    (@justbishop)

    Thank you!

    Thread Starter justbishop

    (@justbishop)

    Just 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.

    Thread Starter justbishop

    (@justbishop)

    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 :/

Viewing 15 replies - 406 through 420 (of 445 total)