Devotion
Forum Replies Created
-
Forum: Plugins
In reply to: [Article List Manager (arlima)] Image size in list?Forum: Plugins
In reply to: [Article List Manager (arlima)] Image size in list?Yep. But I managed to solve it.
Then another issue showed up. When inserting articles as half-width into a list, the image height is different for each article. Sure, I could use Scissors Continued to correct it, but shouldn’t there be a standard size for when displaying half-width, sort of?
Forum: Plugins
In reply to: [Article List Manager (arlima)] Image size in list?I insert the list using shortcode and a PHP code widget. But the image doesn’t fit the width of the list. :S
Image: https://s7.postimg.org/63lfthmmz/Sk_rmavbild_2013_04_19_kl_10_00_15.png
Forum: Plugins
In reply to: [Article List Manager (arlima)] Image size in list?Man, I’m really trying to figure out how to adjust it using that filter. Not getting there.
I also meant the width, not the height. My bad. :/
Hm, weird, according to our web host we do infact have PHP 5.3. :S
I’ll contact them again.
Can’t wait to get this plugin going!
I’ve changed the file permissions, too – no difference.
Forum: Plugins
In reply to: [WPBook] WPBook Custom Post Types?It works!
Very grateful.How do I add on more post types if I create any in the future?
Forum: Plugins
In reply to: [WPBook] WPBook Custom Post Types?Man, I can’t get it to work.
This snippet is correct, right? See below.
} if(get_post_type($my_post->ID) != 'post, nyheter') { // only do this for posts return; }
The two post types being post and nyheter.
I’m not getting any errors or so, it’s just not publishing.
Forum: Plugins
In reply to: [WPBook] WPBook Custom Post Types?John, thank you for this! You guys are awesome.
Forum: Plugins
In reply to: Publish to multiple Facebook walls import comments?Cool. I’ll be waiting. ??
Forum: Plugins
In reply to: EMERGENCY! I need help!Oh, wait, I forgot to add – this is how I solved it. I “simply” added this to my themes functions.php:
function get_post_image ($post_id=0, $width=0, $height=0, $img_script='') { global $wpdb; if($post_id > 0) { // select the post content from the db $sql = 'SELECT post_content FROM ' . $wpdb->posts . ' WHERE id = ' . $wpdb->escape($post_id); $row = $wpdb->get_row($sql); $the_content = $row->post_content; if(strlen($the_content)) { // use regex to find the src of the image preg_match("/<img src\=('|\")(.*)('|\") .*( |)\/>/", $the_content, $matches); if(!$matches) { preg_match("/<img class\=\".*\" title\=\".*\" src\=('|\")(.*)('|\") .*( |)\/>/U", $the_content, $matches); } $the_image = ''; $the_image_src = $matches[2]; $frags = preg_split("/(\"|')/", $the_image_src); if(count($frags)) { $the_image_src = $frags[0]; } // if src found, then create a new img tag if(strlen($the_image_src)) { if(strlen($img_script)) { // if the src starts with http/https, then strip out server name if(preg_match("/^(http(|s):\/\/)/", $the_image_src)) { $the_image_src = preg_replace("/^(http(|s):\/\/)/", '', $the_image_src); $frags = split("\/", $the_image_src); array_shift($frags); $the_image_src = '/' . join("/", $frags); } $the_image = '<img alt="" src="' . $img_script . $the_image_src . '" />'; } else { $the_image = '<img alt="" src="' . $the_image_src . '" width="' . $width . '" height="' . $height . '" />'; } } return $the_image; } } }
Forum: Plugins
In reply to: [WPBook] [Plugin: WPBook] Comments Facebook avatarDon’t worry – I solved it.
And also managed to get some css assignments in there, too.
By doing this:function get_fb_avatar($email,$url) { if(preg_match("@^(?:https://)?(?:www\.)?facebook@i",trim($url))){ $parse_author_url = (parse_url($url)); $parse_author_url_q = $parse_author_url['query']; if(preg_match('/id[=]([0-9]*)/', $parse_author_url_q, $match)){ $fb_id = "/".$match[1];} else{ $fb_id = $parse_author_url['path']; } $grav_url= "https://graph.facebook.com".$fb_id."/picture?type=square"; } else{ $grav_url = "https://www.devotionmagazine.se/wp-content/themes/deadline/images/gravatar.png"; } $grav_img = "<img src='".$grav_url." ' align='left' class='entry_author_image'/>"; return $grav_img; }
Like I said – thanks for your help. Been scratching my head a lot regarding this lately.
Forum: Your WordPress
In reply to: Magazine layout – feedback appreciatedAlright – it’s working again.
Now look. ??Forum: Plugins
In reply to: EMERGENCY! I need help!Solved!
Forum: Plugins
In reply to: [WPBook] [Plugin: WPBook] Comments Facebook avatarYou’re a absolute genius.
It’s working – and it looks good.Just one thing. How can I make it show our own default avatar whenever there’s no Facebook avatar to show?
Which is this one:
https://www.devotionmagazine.se/wp-content/themes/deadline/images/gravatar.pngFor now, it shows the standard, official Gravatar gravatar. (If you know which one I mean.)
I know some PHP and edit a lot of code on a daily basis but a “hack” like this is a bit out of my range of knowledge. I really – really – appreciate your help!