Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 333
Read Don’t include wp-load, please. Then look at this answer to understand the difference to the load of wp-blog-header.php.
Read Don’t include wp-load, please. Then look at this answer to understand the difference to the load of wp-blog-header.php.
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
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
This answer assumes that by dashboard, you’re pointing to the in-built editor accessible from under Appearance > Editor You can use whatever editor you like, they are just normal php files. Open your wordpress install folder, go to “wp-content/themes/”. That directory has all the files. If it’s hosted on some other server you may need … Read more
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
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
I realised I didn’t fully understand the link() function; now I realise that it links the control to the proper setting, making it problematic trying to point multiple controls to one setting. I modified my original function to instead add a hidden input that will hold my final value, along with the checkboxes. I then … Read more
There are two mechanisms in WordPress that would fit your use case: custom taxonomies and post metadata. Since you have already determined that you want something close to mechanics to categories/tags (which are built-in taxonomies) it seems like custom taxonomy is a right fit for your use case. See register_taxonomy() documentation on creating it.
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”; }
You have in many ways already answered your question: the technique described in the article is not going to be reliable. What you might not have worked out is “why”. The code uses relative URLS… <form name=”loginform” id=”loginform” action=”/wp-login.php” method=”post”> … which are nearly always unreliable in WordPress context. That won’t work if the site … Read more