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 {…

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

How to call a specific value within the functions.php file?

function youtube($atts) { global $post; $value = get_post_meta($post->ID, ‘video_link’, true); extract(shortcode_atts(array( //Make sure not to include the ‘value’ as part of this array. “width” => ‘475’, “height” => ‘350’, “name”=> ‘movie’, “allowFullScreen” => ‘true’, “allowScriptAccess”=>’always’, ), $atts)); return ‘<object style=”height: ‘.$height.’px; width: ‘.$width.’px”><param name=”‘.$name.'” value=”‘.$value.'”><param name=”allowFullScreen” value=”‘.$allowFullScreen.'”></param><param name=”allowScriptAccess” value=”‘.$allowScriptAccess.'”></param><embed src=”‘.$value.'” type=”application/x-shockwave-flash” allowfullscreen=”‘.$allowFullScreen.'” allowScriptAccess=”‘.$allowScriptAccess.'” width=”‘.$width.'” height=”‘.$height.'”></embed></object>’; … Read more

Code that displays images – images get shown multiple times

Something like this might work: <?php $cat_id = get_query_var(‘cat’); $catlist = get_categories(‘hide_empty=0&child_of=” . $cat_id); echo “<ul>”; foreach($catlist as $categories_item) { echo “<h1><a href=”‘ . get_category_link( $categories_item->term_id ) . ‘” title=”‘ . sprintf( __( “View all products in %s” ), $categories_item->name ) . ‘” ‘ . ‘>’ . $categories_item->name.'</a> </h1> ‘; echo ‘<p>’. $categories_item->description; $terms = … Read more