Same header/footer in Admin, across all network sites in multisite

Here’s what I did: Inserted ob_start() and ob_get_clean(), at strategic places in header.php and footer.php within a child theme derived from my base site’s main theme. <some header stuff> ob_start() <header html I want to reuse across network> <?php $html = ob_get_clean(); echo $html; harvest_html($html, ‘header’); ?> The function harvest_html simply takes the string and … Read more

Symlinking WordPress WP-ADMIN and WP-INCLUDES

In general it is possible to symlink wp_includes but not wp-admin. The main difference is that various places in admin want to know the path and they calculate it relative to the file which was first invoke to handle the admin request. The problem is that for symlinks PHP returns the path to the actual … Read more

admin uploads pre_get_posts not working as expected

Well first off get_current_screen only works in admin area but even in admin can cause problems on some page. Use the $pagenow global variable instead. So now if you want to hide media not uploaded by a contributor this is how I would do it. // Prevents user to see all uploads, only theirs add_action(‘pre_get_posts’,’wpse_users_own_attachments’); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)