Query for recent images across multiple posts

You can use get_posts or create a new WP_Query using the following args (or something similar). <?php $args = array( ‘post_type’ => ‘attachment’, // attachment post type ‘post_status’ => ‘inherit’, // all attachments have this post status ‘post_mime_type’ => ‘image’, // make sure you get images only ‘posts_per_page’ => 5 // however many images you … Read more

WordPress Custom Menu Widget Style

Purely with CSS you could set a width for menu items, float them and then set the UL to twice that: footer ul { width: 200px; } footer .menu-item { float: left; width: 100px } (I don’t know what elements you are using to designate your footer, you’ll need to update that to match your … Read more

How do i export the HTML from text widgets?

The data in the options table is stored as serialized arrays. Use get_option() to get the data and unserialize them. array_walk( get_option( ‘widget_text’ ), function( $d ){ if ( ! empty( $d[‘title’] ) ) { printf( ‘<p>Title: %s<br>Text: %s</p>’, $d[‘title’], htmlentities( $d[‘text’] ) ); } } ); If you need a complete plugin, use this. … Read more

Widgets not showing in my custom theme

You’re using the widget name and not i.d which is why it isn’t working. Change this: if (is_active_sidebar( ‘My_Widgtet_Area’ ) ) : ?> <div id=”widget-sidebar”> <ul> <?php dynamic_sidebar( ‘My_Widgtet_Area’ ); ?> </ul> To this: if (is_active_sidebar( ‘partner-slide’ ) ) : ?> <div id=”widget-sidebar”> <ul> <?php dynamic_sidebar( ‘partner-slide’ ); ?> </ul> The i.d in the template … Read more