DaveE
Forum Replies Created
-
Forum: Plugins
In reply to: [Flexible Posts Widget] Show only posts with thumbnailsHi Lisa,
I pasted that code into my default template and it is working fine: showing only posts that have a thumbnail. Removing the thumbnail check also showed all posts (thumbnail or not).
There must be some other code interfering with the output of that widget for you. :\
Forum: Plugins
In reply to: [Flexible Posts Widget] Show only posts with thumbnailsSorry about that. I had placed the thumbnail check outside the post loop, which wouldn’t ever work.
I’ve adjusted my previous code example so it is correctly checking inside the loop and I’ve verified that it works with a FPW and the default 2014 theme.
This one should do it for you. Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] Show only posts with thumbnailsGotcha. Well, in that case, it will be easiest to just add the “skip” within the template for that widget’s output. Below is an excerpt from the default widget template with the additional
ifcheck for a post thumbnail.<ul class="dpe-flexible-posts"> <?php while( $flexible_posts->have_posts() ) : $flexible_posts->the_post(); global $post; ?> <?php if( has_post_thumbnail() ): ?> <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <a href="<?php echo the_permalink(); ?>"> <?php if( $thumbnail == true ) { // If the post has a feature image, show it if( has_post_thumbnail() ) { the_post_thumbnail( $thumbsize ); // Else if the post has a mime type that starts with "image/" then show the image directly. } elseif( 'image/' == substr( $post->post_mime_type, 0, 6 ) ) { echo wp_get_attachment_image( $post->ID, $thumbsize ); } } ?> <h4 class="title"><?php the_title(); ?></h4> </a> </li> <?php endif; // has_post_thumbnail ?> <?php endwhile; ?> </ul><!-- .dpe-flexible-posts -->Forum: Plugins
In reply to: [Flexible Posts Widget] Show only posts with thumbnailsHi LisaOr,
While it would be possible to just “skip” posts that don’t have a thumbnail while outputting the widget contents, a better solution would be to actually only get posts that have a thumbnail attached.
Instead of skipping, add this code to your theme’s functions.php file and FPW will only get posts that have a thumbnail attached in the first place:
/** * Filter the Flexible Post Widget query arguments * to only get posts with a attachment thumbnail */ add_filter( 'dpe_fpw_args', 'dpe_fpw_with_thumbs' ); function dpe_fpw_with_thumbs( $args ) { $args['meta_key'] = '_thumbnail_id'; return $args; }Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] add shortcode generatorHi sireneweb,
That’s been requested a couple times. I’ve looked into it a bit and it would be possible, but would be more limited in functionality than the widget as there are a _ton_ of options required to do the complete functionality.
I’ll make sure it’s still on the feature request list. Thanks!
Forum: Plugins
In reply to: [Flexible Posts Widget] Problem with Widget on Category ArchiveHi pxlar8,
Since I haven’r heard back in 2 weeks, I’m going to close this ticket. Please feel free to post again if you have additional questions.
Thanks!
Forum: Plugins
In reply to: [Flexible Posts Widget] Custom Taxonomy & Term Posts Return "No Posts"Hi hutothebert,
Since I haven’t heard back in 2 weeks, I’m going to close this ticket. Please feel free to post again if you have additional questions.
Thanks!
Forum: Plugins
In reply to: [Flexible Posts Widget] Ignore sticky not workingSticky posts are complex, especially in archive and custom query templates.
Is the site online somewhere where I can get access to it? If so, feel free to private message me on Twitter with login information (both a WordPress admin and FTP) and I can take a closer look.
We’ll get it figured out!
Forum: Plugins
In reply to: [Flexible Posts Widget] ExcerptsHi GolfDawgg,
This question has previously been asked & answered. Cheers!
Strange indeed. The hierarchical taxonomy shouldn’t matter, no.
Is the site online somewhere where I can get access to it? If so, feel free to private message me on Twitter with login information (both a WordPress admin and FTP) and I can take a closer look.
We’ll get it figured out!
Forum: Plugins
In reply to: [Flexible Posts Widget] Ignores number of postsHi Golden-Eye-007,
I’m not sure why this would be happening. My first guess is that some code in a plugin or theme in use on your site is unintentionally overriding the queries used by FPW.
Is the site online somewhere where I can get access to it? If so, feel free to private message me on Twitter with login information (both a WordPress admin and FTP) and I can take a closer look.
Sorry for the trouble,
Forum: Plugins
In reply to: [Flexible Posts Widget] [Plugin: Flexible Posts Widget] Styling IssuesHi BosGuy123,
FPW doesn’t add any styles to the public site at all. However, not all themes take into account widgets that are added by 3rd-party plugins. I can’t really give you a one-size-fits all solution as every theme uses a different styling system.
If you are comfortable writing your own styles using CSS, you can always edit your theme’s stylesheet or create a child-theme to work in. Otherwise, you’d probably be better off hiring a designer/front end developer to tackle it for you.
Sorry I can’t be of more specific help.
Does the widget show posts from your Press Releases post type using one of the other settings tabs, Get posts by Post Type, for example?
Also, does it pull a combination of a Page and Post if you set ID’s from one of each of these?
I’m 100% sure that it does work with combined post types for the ID tab. I’m using it on several sites that way.
Forum: Plugins
In reply to: [Flexible Posts Widget] Custom Taxonomy & Term Posts Return "No Posts"Hi hutothebert,
First, have you made sure to set the post type to Staff or Events (for The Events Calendar) for the widget instance? If you don’t set a post type to one that your taxonomy applies to, it will default to “Posts”.
If you are setting the correct post type and it is still not working, have you tried getting regular old posts and a regular old category?
I know for a fact that FPW will work with The Events Calendar. I’ve used it as such. However, it won’t work the way you might expect as the event dates are stored in postmeta values, not in the regular post dates so FPW has no way to properly order them.
One thing I noticed in your code is that you’re flushing the rewrite rules on init. This is a very, very bad idea as every single page load of your website will flush the rewrite rules. I’m not sure if that is causing the issue or not, but regardless, you should probably adjust that code.
let me know if any of these suggestions help. Cheers!
Forum: Plugins
In reply to: [Flexible Posts Widget] Show posts from current category onlyHi
That’s essentially the same as this request. Unfortunately it’s not currently possible, but I’ve added it to the suggestion list for future consideration.
Cheers!