Can’t update/install plugins or WordPress

Fixed it. Put in a few commands that helped give wordpress the permissions it needed to auto update: sudo usermod -aG www-data $USER sudo chown -R www-data:www-data /var/www sudo chmod -R 774 /var/www This problem has been plaguing me for months. I feel like a huge weight has been lifted off my chest now haha.

How do I create a custom add media button modal?

You can inspire from this tutorial here: http://www.sitepoint.com/adding-a-media-button-to-the-content-editor/ For videos you can change the library type to ‘video’: function open_media_window() { var window = wp.media({ title: ‘Insert a media’, library: {type: ‘video’}, multiple: false, button: {text: ‘Insert’} }); } Hope this helps.

Load custom PHP on a custom URL via a plugin

Use is_page(). The is_page() function accepts page title, slug or id. Documentation <?php if(is_page(‘myscript’)) { include ‘/path/to/myscript.php’; } ?> UPDATE To add it to the content, you have two options 1. Find the content function in your template Find either the_content() or get_the_content() in your template. Place it immediately after that function (or before if … Read more

Register Page Template from Plugin

You misunderstand what page_template does. It does not create a new template that you will “show up” somewhere and that you can use. It replaces the page.php template provided by the theme. I think that what you want is template_redirect: function custom_page_template( $page_template ) { if (is_home()) { get_header(); echo ‘do stuff’; get_footer(); } } … Read more

Use wp_enqueue_scripts from included php file

I found the problem…. I ran main.php like: function run_this(){ include’path/to/other.php’; } add_shortcode(‘shortcode’, ‘run_this’); And most of the content of other.php came up exept the hooks did’nt work then i tried using add_action(‘init’, ‘run_this’); and then it worked…. exept that i get a fatal error that i cant redeclare some functions twice 😀

Recreating a local repository from a currently existing wordpress.org repo..which I own

Use this URL format for checkout (if using TortoiseSVN, just right click and do checkout from Explorer): http://plugins.svn.wordpress.org/your-plugin-name You will need to use your username/password for WordPress (the account used to publish the plugin) to do any commits. Command line instructions are available direct from WordPress here: https://wordpress.org/plugins/about/svn/