Tag Info

Hot answers tagged

2

There are no methods the_content() or the_title() of your query object. These: $review_query->the_content(); $review_query->the_title(); should just be the_content(); the_title(); If you had debugging enabled you would see an error informing you of this.


2

<?php $previous_post=null; if ( have_posts() ) { while ( have_posts() ) { the_post(); global $post; if($previous_post!=null) { /// Do what ever you want to do with previous post $previous_post. } $description = get_post_meta( get_the_ID( ), ...


2

When a post is saved, all the data is saved in the database, and a unique ID is assigned to that specific post. All information and attachments for that post is also linked to the post's unique ID. This ID will never change, this post will forever have this ID. The post keeps this ID until the post is PERMANENTLY deleted


2

No they don't change, but you shouldn't rely on them for external sites. If we're talking about purely in the database on an individual WordPress site, then: If it's a published/established post/page then yes, the ID will not change other than to delete it If its a revision, a draft, etc the ID won't change, but it won't survive for very long either. It ...


1

Well, yes, of course. Take a look at this reference: http://codex.wordpress.org/Function_Reference/previous_post_link http://codex.wordpress.org/Function_Reference/next_post_link You can customize it however you like, so you can simply put an html image tag in there. The function must be used in the loop to work. I'd do it like this: <?php ...


1

I found a nice snippet at this site for your functions.php that does the trick: add_shortcode( 'gallery', 'file_gallery_shortcode' ); function file_gallery_shortcode( $atts ) { $atts['link'] = 'file'; return gallery_shortcode( $atts ); } I'd actually been looking unsuccessfully for the same thing, so I'm glad you asked.


1

Here is a start. Create a template called content-related.php Inside that paste the following code <?php /** * The default template for displaying realted posts * * @package WordPress * @subpackage Pieter Goosen * @since pietergoosen 1.0 */ wp_reset_postdata(); global $post; // Define shared post arguments $categories = ...



Only top voted, non community-wiki answers of a minimum length are eligible