the_content(); of custom post type treated as an array or object

single-book.php should not have a custom query in it. WordPress has already queried the correct post, so new WP_Query( $args ) is completely unnecessary. Your problem is that you’re missing the loop. At the bare minimum single-book.php should have: <?php while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content(); ?> <?php endwhile; … Read more

get_post() containing gallery is outputting an unmatched closing div at the end of the content

If you look at the gallery shortcode function the opening div (to match that closer you’re missing) looks like this: $gallery_div = “<div id=’$selector’ class=”gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}”>”; then this filter is run $output = apply_filters( ‘gallery_style’, $gallery_style . $gallery_div ); More than likely there’s code somewhere in your theme or a plugin that’s messing … Read more

What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?

PHP is running on the server, JavaScript in the client. This means PHP is faster (more resources), the result can be cached, and you have to test only one interpreter. JavaScript – you don’t really need jQuery for this – is more error prone, because of weird clients, blocked resources, or a more limited available … Read more

the_content() printing site title after page/post title and before its content

The culprit was within an add_filter function. Commenting out the following removed the site title from above the page/post content: function add_post_content($content) { if(!is_feed() && !is_home()) { $content .= ‘<p>This article is copyright &copy; ‘.date(‘Y’).’&nbsp;’.bloginfo(‘name’).'</p>’; } return $content; } add_filter(‘the_content’, ‘add_post_content’); The first part, “This article is copyright (c)”, printed where you’d expect, but bloginfo(‘name’) … Read more

Giving the_excerpt in the place of the_content?

All good examples. But they weren’t working for me with the theme (pinboard) and plugin I was using (secondary-html-content) and what I wanted to do. The first challenge was to make sure that I get both pieces of content instead of just one. The second challenge was to replace the excerpt on the homepage with … Read more

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