Is there a function to list all uploaded images? How can I add one?

uploaded files are stored as attachment post type in WordPress. Use get_posts() and query for all attachments: $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => null ); $all_attachments = get_posts( $args ); EDIT – you can also set post_mime_type in get_posts to get all of type ‘image/jpeg’ for example.

Help with page nav?

I would recommend using the WP_Nav Menu for your site. To use this feature, just add this in place of your current nav: <?php add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘primary-menu’ => __( ‘Main Menu’ ), ‘secondary-menu’ => __( ‘Secondary Menu’ ), ‘tertiary-menu’ => __( ‘Tertiary Menu’ ) ) ); } ?> … Read more

wordpress admin plugin menu custom css

Use the admin_head hook and just echo out what you need to: function my_admin_head() { // Custom Style echo ‘<link rel=”stylesheet” href=”‘.WP_PLUGIN_DIR.’/style.css” type=”text/css” />’; // Our JS echo ‘<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js”></script>’; } add_action(‘admin_head’, ‘my_admin_head’);

Almost Done… Post Format Code

You can utilize the WordPress function get_template_part(); Create several template files in your theme directory called content-POST_FORMAT_TYPE.php – Example: content-gallery.php and content-chat.php if(has_post_format(‘gallery’)) get_template_part(‘content’, ‘gallery’); elseif(has_post_format(‘chat’) get_template_part(‘content’, ‘chat’); else the_content(); This approach makes your code blocks reusable in multiple templates. Hope this helps you out.

WordPress gallery shortag

There is no way to limit the gallery query in the shortcode_gallery function. However, you can get the child attachments of a post using the following. $attachments = get_children( array(‘post_parent’ => $post->id, ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => $order, ‘orderby’ => $orderby, ‘numberposts’ => 5) ); You will need to … Read more

GET problem in WordPress

There are certain GET and POST calls that WordPress breaks. Such as title, name….If you are using those variables, I would change the name of them.

WordPress plug-in for dynamic download link?

Your idea of using the current date in the filename would be the easiest. In the template for your page, you could have the following to generate your current day link: <a href=”https://wordpress.stackexchange.com/path/to/file/filename_<?php echo date(“Y-m-d’) ?>.pdf”>Today’s file</a> The above uses the PHP date function to create a filename with the current date appended to it … Read more