kath
Forum Replies Created
-
Forum: Themes and Templates
In reply to: add_new_image Hard Crop Not WorkingHum.
For me, the cropping is working, and some of my images are regenerating when I Regenerate Thumbnails, but others aren’t. So WordPress will use the newly created thumbnail with my special sizing and correct cropping for some images, and not for others. All of the images were uploaded prior to the creation of the new image sizes. But it looks like any images uploaded before 2009 didn’t get regenerated. I deleted and re-installed Regenerate Thumbnails and no luck, so I’m just replacing the images.
Forum: Requests and Feedback
In reply to: Better customization for WP List PagesEr, of course when you look more you find the answer. Think this was added since the last time I did this but it’s MUCH BETTER: http://bugssite.org/blog/2009/12/08/wordpress-custom-walker-tutorial/
So hopefully this will make this a little more findable.
This is how I have it implemented:
class Walker_Page_Greenfield extends Walker_Page { /** * @see Walker::start_lvl() * @since 2.1.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of page. Used for padding. */ function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<div class=\"menuwide\"><ul>\n"; } /** * @see Walker::end_lvl() * @since 2.1.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of page. Used for padding. */ function end_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "$indent</ul></div>\n"; } } ?>And
`<?php $walker_pages = new Walker_Page_Greenfield; wp_list_pages(array(‘walker’ => $walker_pages, ‘title_li’ => ”, ‘child_of’ => ‘6’, ‘exclude’ => ‘218’)); ?>’
Forum: Fixing WordPress
In reply to: How to rebuild thumb images?I think the plugin thumbnail manager will do it for thumbs.
Forum: Fixing WordPress
In reply to: Add more image sizesI’m also asking you to post your solution! I could really use this feature.
Forum: Plugins
In reply to: gallery customization: crop thumbs from bottomUpdate: Yes, that worked.
Forum: Plugins
In reply to: gallery customization: crop thumbs from bottomAfter more reading and thinking, I have figured this out more. The part of the code that actually does the cropping is:
imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);… in the media.php file I was talking about in my previous post. According to http://ca3.php.net/imagecopyresampled :
In other words, imagecopyresampled() will take an rectangular area from src_image of width src_w and height src_h at position (src_x ,src_y ) and place it in a rectangular area of dst_image of width dst_w and height dst_h at position (dst_x ,dst_y ).
… So I still want it to be centered horizontally at this point, but I want it to crop from the top of the images, so I will change $scr_y in media.php to 0 and we’ll see what we get …
I tried it and I can’t tell if it’s worked yet, but I didn’t ruin anything. I will update when I can figure it out. I would prefer to keep the variable and write some sort of plugin that will let me choose how to create the thumbnails per image … but that’s probably beyond me.
Forum: Everything else WordPress
In reply to: Get category id for category.php pageThanks for this! It’s really helpful.
Forum: Everything else WordPress
In reply to: What is the “first category”?That’s not quite what I’m curious about, no, but thanks. There’s also a way to grab just the “first category” — let me find where I found this. Here we go:
Template Tags / get the category.
In that page it says:
Show the First Category Name Only
<?php $category = get_the_category(); echo $category[0]->cat_name; ?>(Echoes the first array ([0]) of $category.)
… but it does not specify how (by what mechanism — order of add, alphabetically etc) the first category is chosen. I just want to know in a specific sense what “
(Echoes the first array ([0]) of $category.)” means, IE, are categories stored in the order they are saved to post in the database, or what? I think the normal category listings list alphabetically because they are set to list that way in the default theme. In the barebones theme I’m working with, the first category listed is both (by coincidence) the first category assigened to the post and the first category by id. The code used isPosted in <?php the_category(', ') ?>and it’s definitely not listing categories alphabetically.That was why I put “first category” in quotes — because I want to get a specific category that could be termed the “first category” but I wanted to know how wordpress understands that term.
Forum: Fixing WordPress
In reply to: Fatal error in 2.5 DashboardI’m having the same problem.
this is line 101 of index.php:
$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) );I don’t know PHP very well at all, but could this have something to do with it?
http://www.issociate.de/board/post/211580/Unsupported_operand_types.htmlForum: Your WordPress
In reply to: JimmyIncI think it’s pretty :).
A bit difficult to read when i’ve got my laptop screen tilted strangely, but definitely nice.
Forum: Themes and Templates
In reply to: Get page depthI need to do this too. Anyone know how?
Forum: Plugins
In reply to: Page slug as li idThanks, I needed to do this 🙂
Forum: Themes and Templates
In reply to: wp_list_pages — expandable menuheh. None of it is working, really — does anyone know enough PHP to help me out?
And right now, it only displays pages with a depth of -1.
Forum: Themes and Templates
In reply to: wp_list_pages — expandable menuHi. I’ve figured out how to edit the output of a function once it’s set up, but now I think I need to add some conditionals. Here are the related parts of code:
[long code removed – use something like http://wordpress.pastebin.ca do NOT post long code here!]
Sorry. Total PHP n00b :S.
Forum: Themes and Templates
In reply to: wp_list_pages — expandable menuIt looks like I can only change the heading things. What is wp_walk_tree?
OK, I found wp_walk_tree in post-template.php:
00326: function walk_page_tree() { 00327: $walker = new Walker_Page; 00328: $args = func_get_args(); 00329: return call_user_func_array(array(&$walker, 'walk'), $args); 00330: }So that doesn’t seem like it includes a lot of formatting.
I’d like to know what the apply_filters(‘wp_list_pages’) does.
And I found this in classes.php:
class Walker_Page extends Walker { var $tree_type = 'page'; var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID'); //TODO: decouple this function start_lvl($output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<ul>\n"; return $output; } function end_lvl($output, $depth) { $indent = str_repeat("\t", $depth); $output .= "$indent</ul>\n"; return $output; } function start_el($output, $page, $depth, $current_page, $args) { if ( $depth ) $indent = str_repeat("\t", $depth); extract($args); $css_class = 'page_item'; $_current_page = get_page( $current_page ); if ( $page->ID == $current_page ) $css_class .= ' current_page_item'; elseif ( $_current_page && $page->ID == $_current_page->post_parent ) $css_class .= ' current_page_parent'; $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a>'; if ( !empty($show_date) ) { if ( 'modified' == $show_date ) $time = $page->post_modified; else $time = $page->post_date; $output .= " " . mysql2date($date_format, $time); } return $output; } function end_el($output, $page, $depth) { $output .= "</li>\n"; return $output; } }Which looks like it’s FINALLY where the output is actually defined! HUZZAH. Still not sure if I;m going to be able to edit this to my needs. If I put this function, a new wp_walk_tree, a new wp_list_pages, and a new class, all in functions.php, would it end up breaking?