/wp-admin/ 500 error

I never figured out why my /wp-admin/ was giving me a 500 on my web server but not my local WAMP server. After several hours of going over logs and trying nearly every piece of advice I could find relating to my issue, I opted to export all the posts, pages, menus, etc. from my … Read more

admin_post action not usable if admin access denied to user

What about (1) current_screen? action hook, or a condition for (2) get_current_screen() in your conditional and then calling wp_redirect? Both give you a WP_Screen object which has several parameters, including a $parent_base property that can give broader inclusion if needed, too. Here’s the property list from the codex: $action Any action associated with the screen. … Read more

Add css code in admin_enqueue_scripts

If you’re using the admin_enqueue_scripts hook, use wp_enqueue_script() to enqueue a CSS file with the styles you want to apply. If you want to output a <style></style> element use the admin_head hook to output it between the <head></head> tags: function custom_css_stuff() { ?> <style type=”text/css”> body { color: red; } </style> <?php } add_action( ‘admin_head’, … Read more

How can I use a variable to include a linked image?

You are most of the way there, you simply have to echo it into the include: <a href=”https://wordpress.stackexchange.com/questions/276748/<?php echo $url;?>/image.png”><img src=”https://wordpress.stackexchange.com/questions/276748/<?php echo $url;?>/image.png”></a> If you are already echoing this whole line, then you simply concatenate the variable: echo ‘<a href=”‘.$url.’/image.png”><img src=”‘.$url.’/image.png”></a>’ Do some reading on PHP “concatenation” 🙂