This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (have_posts()) : ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<?php | |
$szPostContent = $post->post_content; | |
$szSearchPattern = '~<img [^\>]*\ />~'; | |
// Run preg_match_all to grab all the images and save the results in $aPics | |
preg_match_all( $szSearchPattern, $szPostContent, $aPics ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$doc = new DOMDocument(); | |
$doc->loadHTML('<img src="http://example.com/img/image.jpg" ... />'); | |
$imageTags = $doc->getElementsByTagName('img'); | |
foreach($imageTags as $tag) { | |
echo $tag->getAttribute('src'); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.main { | |
position:relative; | |
margin-left:20%; | |
} | |
.sub { | |
position:absolute; | |
top:0; | |
bottom:0; | |
width:20%; |