How to make a conditional statement within $output in shortcodes.php?

If I understand you right you just want to use a ‘?’ type of if statement: $output=”<div class=”w-blog-entry” style=”padding:0;”> <div class=”w-blog-entry-h”> <div class=”l-subsection color_dark” style=”background-image: url(“.$the_thumbnail.’); background-position: center center; padding-top:0; padding-bottom:0; background-attachment: inherit;”> <div class=”l-subsection-h”> <div class=”l-subsection-hh g-html i-cf” style=”font-family:Century Gothic; text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);”> <a class=”w-blog-entry-link” href=”‘.get_permalink(get_the_ID()).'”><h2 class=”w-blog-entry-title” style=”line-height:1em; margin-left:0; … Read more

do_action in conditional

Note that did_action only takes one input argument: the name of the action hook. The scope of your if sentence is also unclear. I don’t think you want to use did_action at all here, it doesn’t give you the number of emails. You can try the following instead: if ( $unread = do_shortcode( ‘[input-unread]’ ) … Read more

Conditional featured image with youtube thumbnail

There are three problems 1. echo and php tags within an echo Change your first echo from: echo ‘<img src=”http://img.youtube.com/vi/<?php echo get_post_meta($post->ID,’video_url’,true);?>/0.jpg”/>’; to this: echo ‘<img src=”http://img.youtube.com/vi/’ . get_post_meta($post->ID,’video_url’,true) . ‘/0.jpg”/>’; 2. if statement not wrapped and no brackets change: if get_post_meta($post->ID,’video_url’,true) to: if (get_post_meta($post->ID,’video_url’,true)) and add {} around that code block: if (get_post_meta($post->ID,’video_url’,true)) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)