Articles of post content

Removing Images from a WordPress Post

I wanted to remove the images from a WordPress post to give me more control of how I could layout the design for the front page of a website. After doing some messing around and failing, I finally found a great post which had an amazing little piece of code that solved my problem. <?php […]

custom page with post content using read more

I have a code for a custom page i’m creating that I want to have my own blog archive (formatted customized) this is my code: <?php $args = array( ‘posts_per_page’ => ‘-1’, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘category__in’ => $quicksand_categories ); $query = new WP_Query( $args ); foreach ($query->posts as $item) { $categories = […]

How to filter url on post submission?

I would like to swap out image URLs upon post submission on both content editor field and a custom field cover_image of a custom post type article. For example, the original content may contain image url such as: <img src=”http://img.mywordpresstips.com/custom-post-types/filename.jpg”> I would like to swap it to: <img src=”http://img.mywordpresstips.com/custom-post-types/filename.jpg”> And have it stored permanently to […]

Query posts only with actual text content (not including shortcode or images)

I’m trying to display a set of posts with the thumbnail, title, and content/excerpt. I don’t want to show posts that don’t have content or a thumbnail for display/formatting purposes since this is only going to be shown on my homepage. Here is a live example of working version of what I want it to […]

post_content is stripping HTML when adding a new post?

I have the following in my functions.php file: $post_content = ” Image: <img src=’$featured_image’ /> Address: $event_address Zip: $event_zip Region: $event_region Country: $date_country “; This works fine… But I need something like this: <div class=’activity-listing-content’> <div class=’activity-listing-item’> $image <div class=’activity-listing-item-details’> <span class=’address’>$event_address, $event_region, $event_zip</span> </div></div> </div> Whenever I create the post, all the HTML above […]

Some Post Content Does Not Show Up In DB Search

I am using MySQL Workbench to search for URL’s in my DB, in order to use sql’s update() to change them to a different URL. Easy enough. What bugs me is even then, some of these URL’s, nearly all of which were typed into post content sections by users, do not show up in the […]

I'm having a problem viewing the Youtube video

I’m having a problem viewing the Youtube video. In my single-custom I am using: <? Php echo wpautop ($post-> post_content); ?> And when I put the Youtube link he is not showing the video but only his link. What could be wrong?

Strip HTML Tags From Search Results

When I make a search, if there is an image title within a img tag, it’s displayed in a very ugly fashion among the search results (the whole tag is displayed and the picture too). I found this script which is supposed to solve the problem and this is the only thing I found about […]

Query does not return content

Working on updating an old WP site developed for WordPress 2.0 and have a post (page) query that does not return the “post_content” data. Here is said query: $the_query = query_posts(‘post_type=page&post_parent=50&post_status=publish&orderby=menu_order&order=ASC&posts_per_page=100’); And the returned object (one of them): [0] => stdClass Object ( [ID] => 249 [post_title] => John Doe [link_link] => 1 [no_follow_link] => […]

Display one post in different formats conditionally

I think I just coded myself into a corner. I am setting up a page with an image. The image is an imagemap with lots of links. When you click on the link, it opens a post in a colorbox. So far I have managed to get this part working using a combination of the […]