Chris Schuld's Blog

personal musings on the composition of software

Archive for the ‘WordPress’ Category

Posted by Chris Schuld 2 COMMENTS

A while back I wrote an article on Removing Images from a WordPress Post. Sebastian asked an interesting question; he wanted to remove everything but the images. This is actually pretty straightforward; here is how you do it:   . . . <?php $beforeEachImage = "<div>"; $afterEachImage = "</div>"; preg_match_all("/(<img [^>]*>)/",get_the_content(),$matches,PREG_PATTERN_ORDER); for( $i=0; isset($matches[1]) && [...]

Categories: WordPress
Posted by Chris Schuld 1 COMMENT

From time to time I had have to move one installation of WordPress from one domain (let’s call it domain A) to a new domain (let’s call it domain B). Because WordPress embeds the domain all over the data schema (not faulting; simply disclosing) you have to make a lot of dB changes for the [...]

Categories: WordPress
Posted by Chris Schuld 11 COMMENTS

A while back I wrote a semi-popular post on removing images from a WordPress post — today I am revisiting it. The original solution used the_content() and the output buffer to remove the images out of the post. Now that I have used WordPress a bit longer and candidly had to use the solution again [...]

Categories: Featured, PHP, WordPress
Posted by Chris Schuld 29 COMMENTS

Today I ran across a unique need to remove images from a WordPress post in a specific post loop.  Because there is no way to do a “read more” excerpt while taking strict control of the raw content from the_content() I was limited to capturing and manipulating the content from PHP’s output buffer.  My solution: [...]

Categories: WordPress

About Chris

Chris Schuld

Thank you for visiting my website. I use this site for a myriad of things: maintaining software I have open sourced, connecting with my readers and friends and documenting all of this little things "I wished I would have written down." You can read more about me or contact me.


thanks for visiting... happy coding

Recent Comments