Haz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Child functions.phpAm I on the right track with this?
add_action('after_setup_theme','childtheme_adjust_ec_theme_setup'); function childtheme_adjust_ec_theme_setup() { remove_filter('the_excerpt', 'ec_theme_setup'); add_filter('the_excerpt', 'childtheme_ec_theme_setup'); } function childtheme_ec_theme_setup() { global $content_width; if ( ! isset( $content_width ) ) $content_width = 608; //Set content width add_theme_support( 'post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat') ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 720, 240, true ); add_theme_support('automatic-feed-links'); add_editor_style(); }
Forum: Fixing WordPress
In reply to: Child functions.phpThanks Alchymyth, the tip about eliminating the extra spaces worked, and the function works fine.
Following your pattern, I tried my hand (several times!) at trying to tweak another function to no avail. I get the bit about renaming the child function so it does not conflict with the parent function, but I cannot seem to wrap my head around the “add_action”, “remove_filter” and “add_filter” bits.
Here is the code I am trying to get working in my child functions. I want to be able to set the width of the post thumbnail to something longer than 720px. Changing the width is easy…getting the function to work is a little beyond me.
function ec_theme_setup() { global $content_width; if ( ! isset( $content_width ) ) $content_width = 608; //Set content width add_theme_support( 'post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat') ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 720, 240, true ); add_theme_support('automatic-feed-links'); add_editor_style(); } add_action( 'after_setup_theme', 'ec_theme_setup' );
Thanks in advance for all of your help. I am dying to see what you do with this code so I can compare it to my code that didn’t work.
I think there has been a big improvement. There were bugs and the rest but in the end W3 Total Cache is a very good plugin to use. The performance on my site been the better for it.
And lets not forget that W3 Total Cache is not a simple plugin…it is a very complicated and powerful tool, and problems go with the territory.
And Frederick has been VERY helpful to me and always responded to my support requests in a timely and thoughtful manner. So keep up the good work Frederick and remember that your efforts are not unappreciated.
Forum: Fixing WordPress
In reply to: Child functions.phpThanks Alchymyth
Thanks for getting back to me so quickly. I have tried code similar to that which you have proposed, and I even used your code, and when I save the child functions.php file, I get the following error…any ideas?
Warning: Cannot modify header information – headers already sent by (output started at /home/postpr7/public_html/aquariumcarebasics.com/wp-content/themes/Eclipse-Pro-Child-Theme-2013-02-05/functions.php:31) in /home/postpr7/public_html/aquariumcarebasics.com/wp-includes/pluggable.php on line 876
Here is the function from the pluggable.php on line 876
`
if ( !function_exists(‘wp_redirect’) ) :
/**
* Redirects to another page.
*
* @since 1.5.1
* @uses apply_filters() Calls ‘wp_redirect’ hook on $location and $status.
*
* @param string $location The path to redirect to
* @param int $status Status code to use
* @return bool False if $location is not set
*/
function wp_redirect($location, $status = 302) {
global $is_IIS;$location = apply_filters(‘wp_redirect’, $location, $status);
$status = apply_filters(‘wp_redirect_status’, $status, $location);if ( !$location ) // allows the wp_redirect filter to cancel a redirect
return false;$location = wp_sanitize_redirect($location);
if ( !$is_IIS && php_sapi_name() != ‘cgi-fcgi’ )
status_header($status); // This causes problems on IIS and some FastCGI setupsheader(“Location: $location”, true, $status);
}
endif;Forum: Fixing WordPress
In reply to: Child functions.phpThanks Catacaustic, what you said makes total sense.
An issue for me is that the parent functions.php file on the theme that I’m using does not have the functions I want to tweak wrapped in the check.
I really like the theme so I’m going to have to approach this another way…by using the filter function, and action. At least, that’s what I am thinking.
John T
Forum: Plugins
In reply to: [W3 Total Cache] Defer parsing of JavaScript wordpressYes, this is a good point. I just submitted a Defer parsing of JavaScript feature request for upcoming version updates.
Forum: Plugins
In reply to: [W3 Total Cache] V09.2.7 – looks like its working!Yes! I saw the name-typo as soon as I posted it. Anyway, I’m glad we are working our way thought this and once the dust settles, W3 Total Cache will be the huge asset that we know it to be.
??
Forum: Plugins
In reply to: [W3 Total Cache] Version 0.9.2.6 – Warning: Division by zerofunctions.php on line 670:
$comments_to_posts = number_format(($posts_with_comments / $count_posts->publish) * 100, 0, ‘.’, ”);