Media Library not showing images when adding to Posts (but retrieving image info via ajax)

In case any poor soul runs in to something similar, I’ve found the problem: define(‘WP_DEBUG’, false); Running debug mode (as I do on all dev sites), was throwing a warning, but it was being returned in the ‘admin-ajax.php’ which was preventing the images from showing/uploading and returning the appropriate values etc. I cannot believe the … Read more

Hide a div from a particular page and single pages in WordPress

Just change this: <?php if( is_page() ) { ?> to: <?php if( is_page() && !is_page(42) ) { ?> You can also try to use is_home() and is_front_page(). These 2 will be even better, since they are more universal (not based on pageId). If you change the page that is your home/front page, this will still … Read more

Passing arguments in add_action inside search template

The footer doesn’t run in the global context, so the variable $map_vars is not in the correct scope. To keep the variable and the callback in the same scope, you could use a class: class Map_Var_Example { public static $map_vars; public static function map_data() { var_dump( self::$map_vars ); } } Map_Var_Example::$map_vars=”Test”; add_action( ‘wp_footer’, array( ‘Map_Var_Example’, … Read more

Changing database links has no effect

I can’t tell exactly what you are asking but this comment… What I did recently is that I created a wordpress dir on FTP server and move stuff there, but now people would have to input mydomain.com/wordpress to access my webpage… … makes me wonder it you don’t have a subdirectory install. If that is … Read more