Why is output buffering used here?

you should read HERE or HERE , HERE (and lots of other places ) more about output buffering . If you output some html or javascript code or use echo or print within php, this information is being sent DIRECTLY to the browser in chuncks as the PHP script is processing through the script. but … Read more

Build a list of partners with Link, Logo and text

As NW Tech commented you should use a custom post type for it. Check codex for register_post_type. You could try something like this: function partners_custom_init() { $labels = array( ‘name’ => ‘Partners’, ‘singular_name’ => ‘Partner’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Partner’, ‘edit_item’ => ‘Edit Partner’, ‘new_item’ => ‘New Partner’, ‘all_items’ => ‘All … Read more

Set featured image randomly from WordPress Database on post submission

Here is a way: // listen for post being published add_action(‘publish_post’, ‘dreis_random_featured_image’); function dreis_random_featured_image() { global $post; // find one random image $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’ ); $random_image = new WP_Query($args); foreach($random_image as $image){ // set as thumbnail set_post_thumbnail($post->ID, $image->ID); } … Read more

Globally register styles but enqueue them selectively

If you want the stylesheets registered in the backend, use the admin_enqueue_scripts action. function wp94156_register_styles() { wp_register_style( ‘your-stylesheet’, get_stylesheet_directory_uri() . ‘/your-stylesheet.css’, $deps, // optional $version // optional ); // since you only want it registered, we won’t enqueue it } add_action( ‘admin_enqueue_scripts’, ‘wp94156_register_styles’ );

resetting permalinks after changing page names

Not 100% what you mean. Apologies if this is obvious but… if just want to change the parent page title, and have that reflected in all the link structures you’d change the permalink for the page, just underneath the page title. Or is it something different?