fusionstream
Forum Replies Created
-
Forum: Plugins
In reply to: [Faster Image Insert] Custom “Link URL” sizes.As usual, after deciding to post the question, I find the answer myself.
If you’ve come across it before, please be advised that the ‘title’ field has to be changed to ‘data-link-url’ for it to work with wordpress 4.7.2 and possibly for earlier versions.
This be the code:
add_filter('attachment_fields_to_edit', 'large_attachment_fields_to_edit', 0, 2);function large_attachment_fields_to_edit($fields, $post){ if (substr($post->post_mime_type,0,5) == 'image'){ $html = "<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr(array_shift( wp_get_attachment_image_src($post->ID, 'large', false) )) . "' /><br /> <button type='button' class='button urlnone' data-link-url=''>" . __('None') . "</button> <button type='button' class='button urlfile' data-link-url='".esc_attr(array_shift( wp_get_attachment_image_src($post->ID, 'large', false) ))."'>Large File URL</button> <button type='button' class='button urlfile' data-link-url='" . esc_attr(wp_get_attachment_url($post->ID)) . "'>" . __('Original File URL') . "</button> <button type='button' class='button urlpost' data-link-url='" . esc_attr(get_attachment_link($post->ID)) . "'>" . __('Post URL') . "</button>"; $fields['url']['html'] = $html; } return $fields;}
You’re supposed to put it in the functions.php of your theme but I just put it inside the site specific plugin (which is just a basic plugin that you create so you can put your modified code there instead)
My site specific plugin has this code:
<?php /* Plugin Name: Site Plugin for yoursite.com Description: Site-specific code changes for yourside.com */ /* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */ add_action( 'after_setup_theme', 'default_attachment_display_settings' ); function default_attachment_display_settings() { update_option( 'image_default_align', 'none' ); update_option( 'image_default_size', 'custom' ); // update_option( 'image_default_link_type', 'file' ); add_filter('attachment_fields_to_edit', 'large_attachment_fields_to_edit', 0, 2); function large_attachment_fields_to_edit($fields, $post) { if (substr($post->post_mime_type,0,5) == 'image') { $html = "<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr(array_shift( wp_get_attachment_image_src($post->ID, 'large', false) )) . "' /><br /> <button type='button' class='button urlnone' data-link-url=''>" . __('None') . "</button> <button type='button' class='button urlfile' data-link-url='" .esc_attr(array_shift( wp_get_attachment_image_src($post->ID, 'large', false) )) ."'>Large File URL</button> <button type='button' class='button urlfile' data-link-url='" . esc_attr(wp_get_attachment_url($post->ID)) . "'>" . __('Original File URL') . "</button> <button type='button' class='button urlpost' data-link-url='" . esc_attr(get_attachment_link($post->ID)) . "'>" . __('Post URL') . "</button>"; $fields['url']['html'] = $html; } return $fields; } } /* Stop Adding Functions */ ?>
Forum: Plugins
In reply to: [Faster Image Insert] Updated 4 years ago, still supported?It still works. Not sure about support.
If this plugin one day becomes incompatible, you may lose some functions while editing but it won’t affect your live site at all. So there isn’t too much of a risk there.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Feature Request: Align text.Didn’t say there were errors. This is a feature request. I will check out the CSS portion.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Bug Report: Excerpt truncatedI manually added an excerpt to the post but the excerpt shown in the plugin doesn’t appear to use it.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Feature Request: Align text.https://picpaste.com/Untitled-afbu2DGV.png
The first one with red marking is what I was talking about. All content would align with the top area.
Although now that I see your picture, maybe the 2nd one would also be an option? The description will be contained in a box below the image. The box is shown there though it would be without a border.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Feature Request: Clickable descriptionsYes however the hyperlink is already used for the title so it’s already in memory and need not be retrieved. Then just add an link with the approriate css. I haven’t looked at the code. Maybe this is not how it’s currently done? If I supply a patch would you consider adding it to the plugin? It’s only an option so it needn’t necessarily cause slower loading, not that it would.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Bug Report: Excerpt truncatedIf you open that post you’ll see that because of the image, the excerpt length appears much shorter.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Bug Report: Excerpt truncatedAlso at https://www.singaporefishing.org/blog/
The 4th widget down at the 4th recent post.
Thanks for all these fast replies btw!
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Feature Request: Clickable descriptionsIt would not slow down the plugin as it’s just a css style.
Forum: Plugins
In reply to: [Recent Posts Widget With Thumbnails] Feature Request: Align text.On both firefox and chrome, the lines break under it (not always the second line though).
https://www.singaporefishing.org/blog/
It’s the 4th widget down.
Forum: Plugins
In reply to: [blogsiread] implode(): Invalid arguments passedHi. Do you not have categories?
Forum: Plugins
In reply to: [blogsiread] How to solve?It is designed to return only the first entry.
There is no POST_COUNT but you can find the hardcoded reference to the first entry in widget() in line 71 of the file (for atom) and line 83 (for rss).
On line 89 onwards, if it has successfully read an entry, it populates $vararr[‘feedarray’][] with that first entry only.
In printcontent() on line 220, the html is generated. As it has so far assumed that every $vararr[‘feedarray’][] is it’s own blog, it will generate a new header for every index.
Forum: Plugins
In reply to: [blogsiread] How to solve?You should upgrade your PHP version to 5.3 at least.
Forum: Plugins
In reply to: [blogsiread] Pull image?Do you have a sample of such a feed?
Forum: Plugins
In reply to: [blogsiread] blogsiread isn't workingI’m sorry this has come 3 months later.
If you still require assistance do let me know.