shazdeh
Forum Replies Created
-
What’s IE? ??
Could you provide a test case? (https://css-tricks.com/6263-reduced-test-cases/)Forum: Hacks
In reply to: Modify 'Users > Add New' PageIt this what you need?
// Add Twitter profile field and remove Yahoo IM function add_twitter_contactmethod( $contactmethods ) { // Add Twitter $contactmethods['twitter'] = 'Twitter'; // Remove Yahoo IM unset($contactmethods['yim']); return $contactmethods; } add_filter('user_contactmethods','add_twitter_contactmethod',10,1);
Forum: Hacks
In reply to: Where Can One Set a PHP Global?Are you using something like this?
if( is_home() ) $a = true;
because you see when you go to another page, function.php file get parsed again and the var would be empty. You can use $_SERVER[‘HTTP_REFERRER’] and check it’s value, or use sessions to accomplish that.
Forum: Hacks
In reply to: Save widget options as arraySolved. Don’t use the stripslashes function for these fields in
update
function.Forum: Hacks
In reply to: Modify 'Users > Add New' PageThe way I would do this is using jQuery. Add some JS code in the page using ‘admin_head-{hook-suffix}’ action hook and implement what you need.
Forum: Hacks
In reply to: Speeding up Ajax CallsDon’t you need reading database, access something, use Template Tags or whatever? Don’t you need to load the WP?
Forum: Hacks
In reply to: Where Can One Set a PHP Global?Where are you setting the global? AFAIK, the functions.php file is the first file gets called after loading WP so make sure you are not reading it before setting it.
One thing, this:$a = "Test"; function func() { global $a; $a = "Whatevery"; }
fails and the value will still be what it was outside the function. What you should do is define the var like this:
global $a; $a = "test"; function func() { global $a; $a = "Whatevery"; }
Forum: Hacks
In reply to: Connecting to database inside wordpress?Why aren’t you using the $wpdb global object? Also checkout Codex on databases, WP has built-in function for working with databases.
Forum: Plugins
In reply to: [Header Image Slider] [Plugin: Header Image Slider] Slideshow optionsFor now, you can edit the plugin file directly, on line 171, you see this:
jQuery('div.headerSlider').nivoSlider();
which fires the Nivo Slider. Pass the options like so:jQuery('div.headerSlider').nivoSlider({ option: value });
Sorry for the inconvenience, the next release is gonna be ready really soon.
Forum: Plugins
In reply to: [Header Image Slider] [Plugin: Header Image Slider] Does not show slides…@chrizze: I think the problem is with the date-picker script in Custom Contact Form. It makes this error: “Uncaught TypeError: Object [object Object] has no method ‘datepicker'” and as a result it stops the execution of other scripts in the page.
Disable the plugin and check if it fixes the problem.Forum: Plugins
In reply to: [Header Image Slider] [Plugin: Header Image Slider] Does not show slides…The position of slider nav controls should actually be controlled by the theme. For example, on a minimal design, it makes it more beautiful if the controls are below the slider itself. Nonetheless I’m planning on a visual UI to control their position.
You can use this bit of CSS to change it’s position:.nivo-controlNav { bottom: 5px; }
@chrizze: I saw your website. I’m not sure what’s the problem, but I continue to debug it and I’ll let you know as soon as I find out.
for most users, if there was a way to achieve this without destructively editing a file in the default theme
As I said, the header_image function only returns the URL of the image. I could do output buffering, but AFAIK it slows down the pages.
One way to address this is to use JavaScript to remove the header image and then replace it with the slider. Do you think it’s a good idea?Forum: Plugins
In reply to: [Header Image Slider] [Plugin: Header Image Slider] Does not show slides…Are you using the boom_header_image() template tag? Built-in header_image() function only returns the image URL, so except using Output Buffering in PHP, I have no choice but to make you use a template tag.
Now, in TwentyEleven you must remove this whole chunk in header.php:<?php // Check to see if the header image has been removed $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <?php // The header image // Check if this is a post or page, if it has a thumbnail, and if it's a big one if ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) && $image[1] >= HEADER_IMAGE_WIDTH ) : // Houston, we have a new header image! echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); else : ?> <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> <?php endif; // end check for featured image or standard header ?> </a> <?php endif; // end check for removed header image ?>
and replace it with boom_header_image().
Please let me know if it worked.Forum: Plugins
In reply to: parameters for add_theme_supportFound it. use get_theme_support( $feature ) function which will return the parameter passed to add_theme_support.
Forum: Plugins
In reply to: Can I have url parameter?It’s damn easy that I didn’t believe it first! Thanks man!