Fallback media image for featured image not working in admin column

wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0] will only echo the URL of the image. You need to add it to html to display the image. Try this: echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'”/>’; You could add the width etc as well echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'” width=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[1].” height=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[2].” />’; what happens if someone deletes this image though? Do you have … Read more

Find Memory Usage of Admin

The easist way is the plugin WP System Health, great plugin and works fine. Alternativ you build a function and hook in wp-admin; example admin_footer

Show info to author only

Just compare display names: $currentuser = get_currentuserinfo(); if ( get_the_author() == $currentuser->displayname ) { // current user is the post author; do something } The get_the_author() function returns displayname, which should be able to be compared against the displayname parameter that is a part of the $currentuser object.

How to get “Widget Logic” plugin’s input value in a custom widget code (to display on the Widget admin page)

I’m almost sure there is no way to do that (server side) without hacking core files, bu luckly i know a little jQuery and i’ve come up with this hackish function that does the job just fine: function widget_logic_hack(){ global $pagenow; if ($pagenow == ‘widgets.php’){ ?> <script> function hack_logic(){ jQuery(‘input[id$=”widget_logic”]’).each(function() { if (jQuery(this).val().length === 0){}else{ … Read more