janw.oostendorp
Forum Replies Created
-
Forum: Plugins
In reply to: [Default featured image] Feature request – default images by categoryHello Londonnet,
The plugin does not do this out of the box but I did leave an opening for it. I don’t support it because how should I handle multi categories, sub categories and all other variations.
The way you suggest can work but someone else might need something completely else.To make this you do need to know a bit of code. An example to get you started.
function dfi_category ( $dfi_id, $post_id ) { // all which have 'animals' as a category if ( has_category( 'animals', $post_id ) ) { //sub category if ( has_category( 'cats', $post_id ) ) { return 7; // cats img id } else if has_category( 'dogs', $post_id ) { return 8; // dogs img id } return 6; // default animals img id } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_category', 10, 2 );
Forum: Plugins
In reply to: [Default featured image] Does this plugin support multisite?Hi Londonnet,
Yes it does. I have it running on a multisite on which it is network enabled. And it is present on the settings->media page of individual sites.
Can you check again?
Forum: Plugins
In reply to: [Default featured image] Move settings page to custom post type sectionHello chronicbubble,
I’m sure this can be done, but to achieve this there has to be changed a lot. Too much to reasonably support.
I can give you some pointers:The setting is added to an existing settings page (media). You will have to create your own settings page under the posttype > add_submenu_page
After which you have to add this to that page.
Also have a look at the API. It’s not the most easy thing to do the first time.
A tutorial to work with it: http://code.tutsplus.com/series/the-complete-guide-to-the-wordpress-settings-api–cms-624
Hope this helps you on your way.
Hi Carl,
I think this can be done. Coudl you try:
if ( is_page($post_id) ) {
Hello Naomi,
I’m afraid I can’t help that much since it should be fixed in the theme, not in this plugin. It can be done if you tweak the template.
You could just hide the images on that page with css.
Or exclude it a filter if you know what kind of page it is. Like described on the faq page.Hope this helps you on your way. Sorry I can’t help more
Forum: Plugins
In reply to: [Default featured image] Exclude certain pages and posts?Do you know how to add/edit files for WordPress? With FTP or something like that.
Forum: Plugins
In reply to: [Default featured image] Exclude certain pages and posts?NP.
Create
wp-content/plugin/dfi-exceptions.php
<?php /** * Plugin Name: Default Featured Images Exceptions. * Plugin URI: https://wordpress.org/support/topic/exclude-certain-pages-and-posts-1 * Version: 0.9 * License: GPL2 */ function dfi_exceptions_skip_page ( $dfi_id, $post_id ) { $exclude_ids = array( 2, // 1 id per line and don't forget the comma 8, ); if ( in_array($post_id, $exclude_ids) ) { return 0; // don't display DFI } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_exceptions_skip_page', 10 , 2 );
And enable the plugin in the wp-admin.
I’s can be found in the edit page in the url.
Hope this helps.
Let me know how it goes.Forum: Themes and Templates
In reply to: Cant see my account info when visiting siteCheck your profile in the wp-admin. There should be a
- toolbar
option.
The theme (or a plugin) might also have disabled it for some reason.
Forum: Plugins
In reply to: [Default featured image] Exclude certain pages and posts?Hi Ratethetrainers,
On the faq page I have some examples of excluding posts:
function dfi_skip_page ( $dfi_id, $post_id ) { if ( $post_id == 23 ) { return 0; // invalid id } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_skip_page', 10 , 2 );
Do you know how to implement this or do you need more guidance?
Hi,
I think the problem can be prevented. But I don’t have time to look at it more closely until monday.
There is a way to make exceptions for post types. In the FAQ is an example for a wiki posttype.
Forum: Plugins
In reply to: [Default featured image] Random ImagesHi,
yes you can:
function dfi_randomimage ( $dfi_id, $post_id ) { // how you fill this array with image id's is up to you. $allowed_image_ids = array( 1, 23, 45 ); $random_image_id = $allowed_image_ids[array_rand($allowed_image_ids)]; return $random_image_id; } add_filter( 'dfi_thumbnail_id', 'dfi_randomimage', 10 , 2 );
If you need any more help let me know.
Forum: Plugins
In reply to: [Default featured image] DFI WooCommerce FacetWPHi Michael,
I tested the fix and implemented it in version 1.4
So it’s save to update.Forum: Plugins
In reply to: [Default featured image] Works only partly for me…Good to hear.
Do keep in mind that I don’t know where else it can effect your pages.
Maybe it’s good but I can’t see/know.Forum: Plugins
In reply to: [Default featured image] Works only partly for me…I don’t know you level of skill. But this does require some coding.
Copy
content-blog.php
from the directory to the yellowpages there do the edits you need.Then replace (line 34ish)
<a href="<?php echo get_permalink(); ?>" title="<?php the_title_attribute( 'echo=1' ); ?>" rel="bookmark" class="featured-image-link"><img src="<?php get_the_image( array( 'size' => 'thumb', 'link_to_post' => false ) ); ?>"/></a>
with;
<?php /*<a href="<?php echo get_permalink(); ?>" title="<?php the_title_attribute( 'echo=1' ); ?>" rel="bookmark" class="featured-image-link"><img src="<?php get_the_image( array( 'size' => 'thumb', 'link_to_post' => false ) ); ?>"/></a>*/ ?> <a href="<?php echo get_permalink(); ?>" title="<?php the_title_attribute( 'echo=1' ); ?>" rel="bookmark" class="featured-image-link"><?php echo get_the_post_thumbnail( get_the_ID(), 'thumb'); ?></a>
Not tested. But it should work
Forum: Plugins
In reply to: [Default featured image] Works only partly for me…Hi John,
I looked at the themes and the fault is somewhere in
get_the_image()
function. It’s a big function, I don’t know where is is going wrong. I suggest overruling thecontent-blog.php
file and swithing theget_the_image()
with one of the default WordPress functions which should work wit my plugin.