Featured image to grayscale with PHP imagefilter – which hook to use?
Featured image to grayscale with PHP imagefilter – which hook to use?
Featured image to grayscale with PHP imagefilter – which hook to use?
My Webhoster has enabled mod_pagespeed by default. I had to turn this off via entering ModPagespeed off in my .htaccess file. Abhik also pointed to this in his comment.
The solution to this is pretty ugly. First, I am going to have to create all posts in this system starting at a high ID number (say, 10000). I’ll have to do this via wp_insert_post with the “import_id” suggestion. That will move all the content I don’t want the user to be able to touch, … Read more
in the basic configuration the user role contributor and subscriber do not have the capability upload_files. The user role author has this capability. The capability upload_files gives the user the panels “Media” and “Media > Add New”. If you want another role to grant this capability, you can use the function add_cap(). Since such changes … Read more
This plugin finds the image files which have not been used within a post or page and displays them for deletion from both your uploads directory and database. Images you have uploaded and used in other area’s of your site will also be displayed. Only problem is it hasn’t been updated in a while. WordPress … Read more
Like most page loads in WordPress, WP_Query is intimately involved meaning pre_get_posts is your friend. Proof of concept: function step_2($qry) { $qry->set(‘post__not_in’,array(468,303)); } function step_1() { add_action(‘pre_get_posts’,’step_2′); } add_action(‘load-upload.php’,’step_1′); I’m using the load-upload.php hook to isolate the filter to the “Library” page. If you’ve changed the uploads folder for your avatars you’ve already got some … Read more
The missing element that makes a file appear in the media library is the attachment post. Attachment posts hold the file metadata, and are what get associated to posts via the post_parent when a file is “attached”. Instead of wp_handle_upload, you can use the function media_handle_upload, which will handle the file upload as well as … Read more
Try using the Advanced Custom Fields plugin: http://www.advancedcustomfields.com/ You can add a file(s) upload field to your “designs” post type, and hide the regular content editor. Then you can create a custom template for that post type that displays the files attached to the post.
For custom fields in the backend (like an extra image or extra text) in a post backend we are using Advanced custom fields. This is for us the most easy way to add extra variables to the backend. They also have a function especially for images or a gallery. In your theme you can use … Read more
do you have a custom meta field associated with the image? if so place this in your functions.php: <?php $trim_length = 21; //desired length of text to display $custom_field = ‘your custom field key here’; $value = get_post_meta($post->ID, $custom_field, true); if ($value) { echo ‘<p>I want to use: ‘ . rtrim(substr($value,0,$trim_length)) . ‘…</p>’; } ?> … Read more