Customize the WordPress Default Gallery Output

Like always is WordPress, there is a filter to do this, without the need of a regular expression, that might fail if anything changes. Here is the code for the output: <?php add_filter(‘wp_get_attachment_image_attributes’, function($attr, $attachment){ unset($attr[‘alt’]); // Just deleting the alt attr return $attr; }, 10, 2); $url = wp_get_attachment_url( $attachment->ID ); $name = esc_attr( … Read more

Multiple sites/domains with content all managed by single installation of WordPress

This should be doable. First step would be pointing each domain to the same document root/install of WordPress. Next up, use WP_HOME and WP_SITEURL in wp-config.php that change based on $_SERVER[‘HTTP_HOST’]. Example: <?php define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp’); That should force your permalinks (at least the ones generated dynamically), enqueues, … Read more

How do I add a new template to my site

You can install a File Manager within WordPress, Search the Plugins. Or the easyist way to be honest is simply login via FTP to your web host locate the template folder within wp-content/themes/yourtheme/ and create a file with the name you want to have it. i.e wp-content/themes/yourtheme/mycustom.php just insert in the empty file. and then … Read more

Remove template drop down for certain pages

The “How?” To get rid of a meta box, you got several hooks straight after they were added inside ~/wp-admin/edit-form-advanced.php. The one you need it ‘dbx_post_advanced’. The you just need to remove the meta box with remove_meta_box(). <?php defined( ‘ABSPATH’ ) or exit; /** Plugin Name: (#90253) Remove Page Template Drop Down */ add_action( ‘dbx_post_advanced’, … Read more

Defined Blogname Override?

The name comes from get_option(‘blogname’). So you can filter it in a mu-plugin: add_filter( ‘option_blogname’, ‘local_blogname’ ); function local_blogname( $name ) { return “✋ $name”; }

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