Retrieve post thumbnails

<?php /* Template Name: Ron’s WordPress Answers Template */ include_once(‘header.php’); $args = array( ‘posts_per_page’ => 5, ‘offset’ => 0, ‘category’ => ”,//you have to use the category id # here not the name of the cat ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘suppress_filters’ => true ); $posts = get_posts( … Read more

private functions in plugins

Well, it is not possible, I guess. If you define function in global scope, then it is visible for all code. The only way to make it private for plugin is to use OOP (and it’s recommended way of writing plugins). You can rename this function, but it won’t solve your problem in the long … Read more

Create custom fields on a post

I would add my Custom Post Type (Person). You can do this with register_post_type function. Then you have to add your custom fields. And the easiest way to do this will be Advanced Custom Fields plugin. It allows you to define additional custom field groups that will be added to posts (based on some rules). … Read more

How to include css for plugin setting page? [duplicate]

Refer documentation Link Scripts Only on a Plugin Administration Screen add_action( ‘admin_menu’, ‘my_plugin_admin_menu’ ); function my_plugin_admin_menu() { /* Add our plugin submenu and administration screen */ $page_hook_suffix = add_submenu_page( ‘edit.php’, // The parent page of this submenu __( ‘My Plugin’, ‘myPlugin’ ), // The submenu title __( ‘My Plugin’, ‘myPlugin’ ), // The screen title … Read more