Michael Fields
Forum Replies Created
-
Forum: Plugins
In reply to: Thumbnail as menu itemThis should be rather easy by defining your own Walker class that extends the built-in Walker class. I would suggest copying the code in Walker_Nav_Menu and then change it to work how you want. Something like:
class MyTheme_Walker_Nav_Menu extends Walker { /* Paste code from Walker_Nav_Menu here. */ }You can then create an object of your custom class and pass it to
wp_nav_menu(). Something like the following should work:$mytheme_walker = new MyTheme_Walker_Nav_Menu(); wp_nav_menu( array( 'walker' => $mytheme_walker ) );Forum: Fixing WordPress
In reply to: How to Remove or Replace Code from the Admin PanelVery simple solution that I found a few weeks ago. I love it too! Can’t take credit though 🙂
Forum: Fixing WordPress
In reply to: Fatal error: Call to undefined function wp_get_current_userI’ve ran into similar problems in the past. I think that this happens because (in the first instance) you are using
current_user_can()before all appropriate files have been loaded. I’m guessing that the “code in another file” is hooked into WordPress at a later time in script execution. I try to hook everything atwp_loadedor later if possible.Forum: Fixing WordPress
In reply to: How to Remove or Replace Code from the Admin PanelLooks like you want to add a custom logo you administration page? If so, please try this code in your theme’s functions.php or a custom plugin:
//hook the administrative header output add_action('admin_head', 'my_custom_logo'); function my_custom_logo() { echo ' <style type="text/css"> #header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; } </style> '; }If you want to tweak the Favorites menu, code like the following is in order:
add_filter('favorite_actions', 'custom_favorites'); function custom_favorites($actions) { $actions['options.php'] = array('All Settings', 'unfiltered_html'); return $actions; }Forum: Fixing WordPress
In reply to: links and imagesis there a way to change where wordpress looks for things like files and images? what it is doing, is instead of looking in the wordpress directory for files, it looks for http://domain/post-name/file-name… which is really frustrating because it can’t find my images or php files (such as the mailform… kinda important). please help!!!!
it sounds like you are using relative urls. Does your image markup look similar to this:
<img src="my-image.png" />If so, you should use an absolute url:
<img src="http://example.com/my-image.png" />if anyone knows how to get it to stop double spacing breaks that would be great too.. i have some lists of things that it’s expanded wayyy beyond the amount of space they should be taking up.
If you are using the visual editor, try to hold down the shift kye before you press enter.
Best wishes,
-MikeForum: Fixing WordPress
In reply to: reverse get_category_parentsThis should do the trick:
$sep = '»'; $parents = get_category_parents( $cat, TRUE, $sep ); $parents = explode( $sep, trim( $parents, $sep ) ); $parents = array_reverse( $parents ); $parents = implode( " $sep ", $parents ); print $parents;Forum: Themes and Templates
In reply to: How can I get wp_list_pages separated by commasAwesome, Glad to hear it!
Forum: Themes and Templates
In reply to: WordPress functions inside javascriptSomething like this should work:
wp_enqueue_script( 'mytheme-ufvalidator', '/full/path/to/jquery.ufvalidator.js', array( 'jquery' ) ); wp_localize_script( 'mytheme-ufvalidator', 'myThemeUfvalidator', array( 'imagesUrl' => get_bloginfo( 'stylesheet_directory' ) . '/images/' ) );Further reading:
http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin
http://ottopress.com/2010/passing-parameters-from-php-to-javascripts-in-plugins/
Forum: Your WordPress
In reply to: WordPress theme critiqueI think that it looks pretty great! The only criticism that i have is that I cannot really figure out what the purpose of the site is immediately. The homepage has no in-your-face indicator that you are a web professional.
On a picky note, I would suggest that you kill the outlines on the links that creep up the right hand side of the page (MERLINVICKI, Mani & get in touch ). They stretch all the way across the page in Firefox 3.5.11.
Other than that it’s a really great design. Good work!
Jaygoldman,
Thanks for taking the time to submit the bug report! I updated the plugin as you suggested and this bug can be considered squashed. Version 0.4.4 and beyond will have the fix.Forum: Plugins
In reply to: Custom post_status in 3.0TheDailyCrowdsource,
Thanks for writing. I have abandoned this for the time being… at least until it is better supported in core. I had a chat with Andrew Nacin on Twitter where he compared support for custom post_statuses in 3.0 to that of custom post_types in 2.9. They are there and you can register them, but there’s not much else you can easily do with them yet. Although I’m really excited to use custom post statuses… I’ll just have to wait. Sorry I can’t be of more help to you.Forum: Hacks
In reply to: Seperate/Different Template for Category and Sub-CateogryMaybe this is what you are looking for?
add_action( 'template_redirect', 'my_theme_child_category' ); function my_theme_child_category() { global $wp_query; $obj = $wp_query->get_queried_object(); if( isset( $obj->category_parent ) && 94 === (int) $obj->category_parent ) { require STYLESHEETPATH . '/category-94.php'; exit; } }Forum: Plugins
In reply to: Necessity for a SEO plugin using wordpress as cmsI am using wordpress as cms.
I think it’s safe to say that anyone using WordPress is using it as a CMS. That’s what it is 🙂
However, I have to add <?php wp_head(); ?> to make this plugin work fully. That function seems to add some extra code which I think is not necessary.
If you are creating a site for a client, I HIGHLY SUGGEST that you include <?php wp_head(); ?> in header.php. Not doing so will disable your client from taking advantage of the hundreds of plugins that use the ‘wp_head’ action hook.
If I hardcode the meta tags for the 6 pages, I think I would not need a SEO plugin.
I agree.
Is there any necessity for me to use a SEO plugin?
In my opinion, “no”. But other will disagree. I guess it comes down to how many features you want to extend to your client.
Best wishes,
-MikeForum: Fixing WordPress
In reply to: Thumbnail Size not acceptem form WpWhich image size is specified in
the_post_thumbnail()? Usually this will not be the size set in options -> media, but the size that your theme specifies viaset_post_thumbnail_size().I would suggest that you track down all calls to
the_post_thumbnail()in you theme and change the second parameter to ‘thumbnail’.Something like this should work:
get_the_post_thumbnail( null, 'thumbnail' )Forum: Fixing WordPress
In reply to: Displaying children content on parent pagecrondeau,
Glad you got it all figured out. Please note that that when you are accessing the global $post variable (as you are in the loop for $childpages) that you back it up before hand and then reassign it after you are done using it. Not doing so can have undesired effects throughout your theme.