Make wordpress generate a custom XML file(not a sitemap) that is updated only when new content is posted?

Hmm… not sure if there are any WordPress-specific functions for creating files. There’s wp_handle_upload, but I’m not sure how you’d use it in this context. Depending on your server configuration, you can probably just use fopen and fwrite to do this. Keep the code you’re currently using (with your custom loops…I’m assuming they contain the … Read more

How to run JS, PHP and etc. inside WP post?

Natively WordPress posts are subset of HTML (even more like semi-HTML – paragraph tags can be implied and added on output, but not stored). As result it really really doesn’t like to store or process active code in post’s content. This applies both to internal logic in PHP and front-end logic of post editor (it … Read more

Force CSS and JS loading of plugin only where needed

is_admin() is useful for the front end. The load-$pagenow hook and a few others are useful on the backend. wp-admin/admin-header.php, for instance, contains: do_action(‘admin_enqueue_scripts’, $hook_suffix); do_action(“admin_print_styles-$hook_suffix”); do_action(‘admin_print_styles’); do_action(“admin_print_scripts-$hook_suffix”); do_action(‘admin_print_scripts’); do_action(“admin_head-$hook_suffix”); do_action(‘admin_head’); Note the $hook_suffix variable, which you can var_dump() then and there to know what its value is when your plugin’s page is being loaded.

How do plugins get executed automatically from wp-content?

I know, myself, using a multi site WordPress install, plugins dropped into the mu-plugins folder (wp-content/mu-plugins/) are activated automatically. In this case mu representing must use. However, I am not 100% positive if this is dependent upon the type of install a single site blog install or multi site/network install. I found an article outlining … Read more

First WordPress Plugin – Stat Issues

I’m having the same problem. Take a look at the opening comments of content-types-wordpress-plugin.php, it looks like there are extra line breaks between each line, which may disrupt the parser that pulls out the version number, etc. If you don’t see the extra breaks when you develop locally, you may have to play with the … Read more

Need help restoring my WordPress blog

Have you tried removing the wp-cache folder? I had a bad update of a different plugin once and simply “uninstalling” it by removing it from the wp-content/plugins folder allowed things to run normally and I installed an older version of the plugin.

How to determine if a plugin affects your file-system

Such tracking is not practical, at least not in context of WordPress. When we use software we don’t fully realize just how much activity is going on behind the scenes. Tracking it is massive overhead and can easily ruin performance. I remember plugin that use checksum-based verification on WordPress files, but I don’t know if … Read more

Translate database content using __($message) function

If you want to have variables in your text to be translated the usual way would be with string formatting like so: <?php printf(__(“text %s text2.”), $message); ?> with integers: <?php printf(__(“text %d text2.”), $count); ?> with more then one placeholders: <?php printf(__(“text %1$s text2 %2$S.”), $message, $message2); ?> but the variable it self will … Read more