How to use custom fields to replace top-level parent title with an image using wp_list_pages?

I went to the #wordpress irc channel and was given the answer by Marko Heijnen. He grabbed the Walker Code from /wp-includes/post-template.php and added a few lines to it. /** * Extend the default page walker class to append class names for pages that * are parents. * @uses Walker_Page * * http://wordpress.stackexchange.com/questions/11821/class-parent-for-wp-list-pages * */ … Read more

Automatically load WordPress page on server every XX hours

You could use the WP-Cron functions to scheduled events. Note though that this is pseudo-cron- it requires someone (or a bot) visit your site for the events to execute. To fire events more reliably, search for scheduling cron jobs (linux) or scheduled tasks (win). Depending on your hosting, you may have access to simple tools … Read more

Warning: Cannot modify header information (with a twist)

Goin with @One Trick Pony… Change: <?php /* You really don’t want to touch this file if you don’t know what you’re doing. */ ?> <?php class WP_LESS_Styles extends WP_Dependencies { …. To: <?php /* You really don’t want to touch this file if you don’t know what you’re doing.*/ class WP_LESS_Styles extends WP_Dependencies {…

Showing author box on post detail page

Where is your code for the author appearing (what files > category / post / single?)? I would guess you have the author code within either a category or post template file, simply add the author code to the single template file (create single.php if you don’t have one) and remove from the upper level … Read more

how to edit wp category widget

// This alters the get get_terms() arguments and hides some categories function widget_category_excluder( $args ) { // Replace the numbers with category IDs you need hidden $args[‘exclude’] = $args[‘exclude’].’,1,2,3,’; // Keep it safe! // Or use exclude_tree to exclude children categories also // $args[‘exclude’] = $args[‘exclude’].’,1,2,3,’; // Keep it safe! // (,1,2,3, is enclosed in … Read more

Dynamically append custom post type to end of url

Here is something I came up with to solve this exact problem. add_action(‘wp_list_categories’,’example_wp_list_categories’); function example_wp_list_categories($output) { global $post; foreach (get_categories() as $cat) { if (preg_match(“/\/category\/$cat->slug\//”, $output)) { $output = str_replace(‘/category/’ . $cat->slug . “https://wordpress.stackexchange.com/”, ‘/category/’ . $cat->slug . ‘/?post_type=” . $post->post_type, $output); } } return $output; } Regex isn”t a strong point of mine, so … Read more

custom data in url

You can use the details here in this answer to solve your problem : Pretty URL with add_query_var Something along the lines of add_rewrite_endpoint(‘item’, array(EP_PAGES)); resulting in a rewrite rule that would let you use /prof/vac/item/1234 which you would then check in the vac pages template for a query variable ‘item’ and pull its value … Read more

Error on Include php:/usr/share/pear

Would it not make more sense to use get_template_part() ? What may be happening is that there is no 404 template: if ( ” != get_query_template( ‘404’ ) ) include( get_query_template( ‘404’ ) ); http://codex.wordpress.org/Function_Reference/get_query_template This may be because pretty permalinks have been turned off, or because there is no 404 page template to be … Read more