r1kay
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Hacks
In reply to: Problem with constructing the single post lay-out through funtions.phpThanks for your reply bcworkz!
I’ve tried the scope resolution operator but it will result in a blank page.
function content_injector($content) { global $wp_query; $postid = $wp_query->post->ID; if (is_single((get_post_meta($postid, 'top_ad', true) != 'off' ))) { $top_ad = do_shortcode('[td_ad_box spot_name="Ad spot -- topad"]'); } if (is_single((get_post_meta($postid, 'bottom_ad', true) != 'off' ))) { $bottom_ad = do_shortcode('[td_ad_box spot_name="Ad spot -- topad"]'); } if (is_single()) { $review = td_module_1::get_review(); $custom_share = '<div id="title-deel"><h4 class="block-title"><span>DEEL</span></h4></div>' . do_shortcode('[ssba]'); $facebook_comments = '<div id="title-reageer"><h4 class="block-title"><span>REAGEER</span></h4></div>' . '<div class="fb-comments" data-href="' . get_permalink() . '" data-colorscheme="light" data-numposts="5" data-mobile="false" data-width="700"></div>'; } $content = $top_ad . $content . $review . $bottom_ad . $custom_share . $facebook_comments; return $content; } add_filter('the_content', 'content_injector');
So this did not work, or did i do something wrong. I couldnt find an object reference in the code…
Forum: Hacks
In reply to: Help needed: Adding YouTube parameters to oEmbed functionbcworkz, i’ve managed to modify a piece of coding that was posted by someone else in a similar thread 2 years ago.
to make it work i used this:
function Oembed_youtube_no_title($html,$url,$args){ $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $id); if (isset($id['v'])) { return '<iframe width="100%" height="394" src="https://www.youtube.com/embed/'.$id['v'].'?rel=0&?wmode=transparent&iv_load_policy=3&showinfo=0&vq=hd1080" frameborder="0" allowfullscreen></iframe>'; } return $html; } add_filter('oembed_result','Oembed_youtube_no_title',10,3);
Forum: Hacks
In reply to: Help needed: Adding YouTube parameters to oEmbed functionThanks bcworkz,
I’ve added to code to the theme’s functions.php but it will break the website. Do you have any suggestions what part of the code needs to be tweaked?
Forum: Hacks
In reply to: Help needed: Adding YouTube parameters to oEmbed functionThanks for the feedback, but I really lack PHP skills. Could you provide me with the right code?
Viewing 4 replies - 1 through 4 (of 4 total)