Showing the attachment for a page?

Use, wp_get_attachment_image_src( $attachment_id, $size); Specify the size parameter as follows; $size (string/array) (optional) Size of the image shown for an image attachment: either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32). As of Version 2.5, this parameter does not affect the size of … Read more

How to change text (date) in post base on the day

Here’s summed up what you need to do: Get a meta box library. Add custom fields with dates Attach a filter callback action to the_content filter Get the current date, check your custom fields, append date in content. So here’s the filter callback, that lets you append your “next date”: function wpse66615_date_to_content( $content ) { … Read more

Setting default category for display

I’m not sure you are understanding what a ‘category page’ is doing; for example your news page: http://papermepress.com/?cat=1 this is pulling out all post with the categoy ‘news’ which has cat id equal to 1. depending on your needs there are two possible things you can do. 1 – if you simply want all posts … Read more

Wrap Featured Image in a Link

Unless there’s some part of your problem I don’t grasp, what’s wrong with a simple mash-up of the two given snippets? <?php global $post; $urlbox = get_url_desc_box(); $post_thumb = get_the_post_thumbnail( $post->ID, ‘screenshot’ ); if( !empty( $urlbox[0] ) && !empty( $post_thumb ) ) { echo sprintf( ‘<a target=”_blank” href=”https://wordpress.stackexchange.com/questions/66759/%1$s”>%2$s</a>’, $urlbox[0], $post_thumb ); } ?> Edited: get_the_post_thumbnail … Read more

Any way to insert text on page from a query results?

Ok, but I was afraid it’s not really a good solution. Works, though. First, I rewrote the query in order to get pretty permalinks: /*Añadido: Reescribir URL query: “?pa_dispositivo=nombre&pa_marca=nombre”*/ function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘tipo/(.+)/marca/(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1).’&pa_marca=”. $wp_rewrite->preg_index(2) //”(.+)’ => ‘index.php?pa_marca=”. $wp_rewrite->preg_index(1) //”(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1) ); $wp_rewrite->rules = $feed_rules + … Read more