Resizing to bigger proportions as original not working

When you add the image to the post Select “Full Size” Click “Edit Image” Click the “Scale” button Manually edit the dimensions Save all changes Check to see if “Full Size” has your new dimensions Click “Use as featured image”

Create plugin/function to catch XML-data via Shortcode

If this file is remotely available to you, then you should be using the HTTP API. $response = wp_remote_request( ‘http://xml.prisguide.no/productExport.php?productId=151690’ ,array( ‘ssl_verify’ => true // If the request isn’t working, try it with `false` ) ); You then simply go and catch the response and check if it’s an error: if ( is_wp_error( $response ) … Read more

Change the behaviour of archive cpt category and single cpt by plugin, not by theme

You can use templates located within your plugin instead of theme files, like so: add_filter(‘archive_template’, ‘redirect_to_plugin_archive_template’); function redirect_to_plugin_archive_template($template) { if(is_post_type_archive(‘my_cpt’)) { return dirname(__FILE__) . ‘/templates/my_archive_template.php’; } } add_filter(‘single_template’, ‘redirect_to_plugin_single_template’); function redirect_to_plugin_single_template($template) { if(is_singular(‘my_cpt’)) { return dirname(__FILE__) . ‘/templates/my_single_template.php’; } } Obviously you need to change the custom post type slug and the template paths, but … Read more

How to exclude certain portfolios from a loop

so I am thinking your $arg would be: $args = array( ‘numberposts’ => $portfolio_items, ‘order’ => $portfolio_sort, ‘orderby’ => ‘date’, ‘post_type’ => array(‘portfolios’), ‘offset’ => $offset, ‘exclude’ => ‘1,2’, ); And that would exclude post 1 and 2. But a better option that you should do, is to just create a featured category for your … Read more

Make a magic tag work with Custom Post Types

[Comment reposted as answer at request of OP author:] Rather than deleting them, why don’t you add your post_type to the if() statement: //Don’t process anything but POSTS and PAGES (i.e. no revisions) if( $data[‘post_type’] != ‘post’ && $data[‘post_type’] != ‘page’ && $data[‘post_type’] != ‘foto’ ) return $data; As that comment in the code makes … Read more