lobaat
Forum Replies Created
Viewing 6 replies - 1 through 6 (of 6 total)
-
Thank you for your answer. Will have a look at it!
All the best
/LSure, it’s the black top on the page. Show only the first image without any advancement, https://www.sevenwomen.se/utv/
Or could I be doing something else wrong?
Hm…. I don’t get my promotion slider to work, does it work on WP Version 3.1 and PS Version 3.2.3?
Forum: Fixing WordPress
In reply to: Hellp with a ifSo what I need to find out is IF the post contains a image write my div else write noting….
Think you could help?
Many thanksForum: Fixing WordPress
In reply to: Hellp with a ifOh thanks!
This is the code that allows me to break the content apart (from theme functions.php):// Content Limit function content($num, $more_link_text = '(more...)') { $theContent = get_the_content($more_link_text); $output = preg_replace('/<img[^>]+./','', $theContent); $limit = $num+1; $content = explode(' ', $output, $limit); array_pop($content); $content = implode(" ",$content); $content = strip_tags($content, '<p><a><address><a><abbr><acronym><b><big><blockquote><br><caption><cite><class><code><col><del><dd><div><dl><dt><em><font><h1><h2><h3><h4><h5><h6><hr><i><img><ins><kbd><li><ol><p><pre><q><s><span><strike><strong><sub><sup><table><tbody><td><tfoot><tr><tt><ul><var>'); echo close_tags($content); } function images($num = 1, $width = null, $height = null, $class = 'alignleft', $displayLink = true) { global $more; $more = 1; if($width) { $size = ' width="'.$width.'px"'; } if($height) { $size .= ' height="'.$height.'px"'; } if($class) { $class = ' class="'.$class.'"'; } if($displayLink != false) { $link = '<a href="'.get_permalink().'">'; $linkend = '</a>'; } $content = get_the_content(); $count = substr_count($content, '<img'); $start = 0; for($i=1;$i<=$count;$i++) { $imgBeg = strpos($content, '<img', $start); $post = substr($content, $imgBeg); $imgEnd = strpos($post, '>'); $postOutput = substr($post, 0, $imgEnd+1); if($width || $height) { $replace = array('/width="[^"]*" /','/height="[^"]*" /','/class="[^"]*" /'); } else { $replace = '/class="[^"]*" /'; } $postOutput = preg_replace($replace, '',$postOutput); $image[$i] = $postOutput; $start=$imgBeg+$imgEnd+1; } if($num == 'all') { $x = count($image); for($i = 1;$i<=$x; $i++) { if(stristr($image[$i],'<img')) { $theImage = str_replace('<img', '<img'.$size.$class, $image[$i]); echo $link.$theImage.$linkend; } } } else { if(stristr($image[$num],'<img')) { $theImage = str_replace('<img', '<img'.$size.$class, $image[$num]); echo $link.$theImage.$linkend; } } $more = 0; }?>
Viewing 6 replies - 1 through 6 (of 6 total)