jondaley
Forum Replies Created
-
But, if it is there, someone can just erase it (or add to it), right?
I don’t think there is a downside of including it. Unless you are saying that site owners want to be able to customize that text?
And here is how I did it so I don’t have to edit the plugin code directly (note the #body hack is to make the CSS more specific than the plugin’s own CSS)
#body #youtube-sidebar-widget ul li div.play_arrow {
float: none;
}Ah, just removing the float: left from the play_arrow class fixes it. Negative margins with floats aren’t as well supported as just negative margins.
Turns out that didn’t work, since there is javascript that turns on the link and it doesn’t work if the play_arrow is disabled. I hadn’t noticed since I was playing around via firebug.
I’ll have to keep looking for a good fix.
Yup, confirmed broken on IE9 as well.
I just put:
.play_arrow{ display: none; }
in my stylesheet until it can be fixed.
I played around with it a little bit, but the negative margin hack is probably what is breaking it. There must be an easier way to get the overlay to work.Forum: Plugins
In reply to: [Share and Follow] [Plugin: Share and Follow] Pintrest?Oops – had a character typo, here is the last bit of code from the above post in a nicer format:
$image = ''; if($page_id){ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches); $image = $matches[1][0]; }
This will look for the first image in a blog post and use that image to share on pinterest.
Forum: Plugins
In reply to: [Share and Follow] [Plugin: Share and Follow] Pintrest?And,,, it’s done. It wasn’t too bad, though maybe a little hacky/only for me.
What my version does:
1. Adds the option for pinterest to be selected on the various menus on the admin side:allsites.php: 'service' => 'share,follow', 'share_url' => "https://pinterest.com/pin/create/button/?url=URI&media=MEDIA&description=TITLE",
2. Replaces MEDIA with the url of an appropriate picture:
share-and-follow.php
https://jon.limedaley.com/share-and-follow.phps
(Unfortunately, the share-and-follow plugin seems to be no longer in the wordpress repository? and I didn’t think to keep an original copy before I edited it. If someone has an original, I can do a proper diff on the file.
Basically, all I did was to add a new parameter to the replaceKeywordsInURL function that looks for MEDIA and replaces it with the image URL.The image URL is calculated in social links:
$image = ''; if($page_id){ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches); $image = $matches[1][0]; if(!$image){ // you might like this function instead: get_post_meta($page_id, 'image', true); $image = recipress_recipe(get_post($page_id), 'photoraw', array('max' => 1, 'size'=>'medium')); if(count($image)) $image = $image[0]; else $image = ''; } }
I’m using the “recipress” plugin, though the author was apparently not interested in my modifications and so never responded to my emails about how to send her my code, so I have a heavily customized version (and the above call won’t work for you), so you might just like this version instead, which doesn’t look for custom fields:
$image = ”;
if($page_id){
$output = preg_match_all(‘/<img.+src=[\'”]([^\'”]+)[\'”].*>/i’, get_the_content(), $matches);
$image = $matches[1][0];
}`This will look for the first image in a blog post and use that image to share on pinterest.
Forum: Plugins
In reply to: [Share and Follow] [Plugin: Share and Follow] Pintrest?It isn’t on the sharing tab, because one has to grab the picture that you want to share. I originally thought I could just add it to the allsites.php, but it turns out it is harder than that.
I’m working on a solution to this – probably by doing it the way the “social-discussions” plugin does it, by using some javascript to grab the appropriate image.
My solution is harder than the general purpose solution, because my images are from an image custom field, rather than the associated image with the blog post.
If I get something working that will be useful to others, I’ll post it here.
Forum: Plugins
In reply to: Plug-in: Share and Follow – Can not installJust guessing, but are you doing some sort of custom query and changing the WP_query object, but not calling wp_reset_postdata();
The place where you are getting that error is when $wp_query->get_queried_object() is returning some sort of null or otherwise error value.
Forum: Plugins
In reply to: [ReciPress] [Plugin: ReciPress] Error In Latest 1.9 ReleaseThis bug happens if someone types in an ingredient that wasn’t previously saved in the database.
I changed the code in functions.php like this:
if (isset($the_ingredient)){ $term = get_term_by('name', $the_ingredient, 'ingredient'); if($term) $output .= '<span class="name"><a href="'.get_term_link($term->slug, 'ingredient').'">'.$the_ingredient.'</a></span> '; else $output .= '<span class="name">'.$the_ingredient.'</span> '; }
The main difference is that $term is checked for null before being used. I figure the ingredient should be allowed to be printed, and just doesn’t have a link.