Tag Info

Hot answers tagged

3

It won't be very hard to do. Just add this to your functions.php or into your plugin: function my_edit_per_page( $result, $option, $user ) { if ( (int)$result < 1 ) return 20; // or whatever you want } add_filter( 'get_user_option_edit_page_per_page', 'my_edit_per_page', 10, 3 ); // for pages add_filter( 'get_user_option_edit_post_per_page', ...


2

Don't use the publish date as the event date. Save the event's date in a custom field in the format yyyy-mm-dd, and use a meta query to order events by that date. Also see pre_get_posts for ordering events correctly on archive pages without running a new query.


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 = ...


1

Have not tested it but this should get you to your goal. I believe Accore LTD has it correct as well, except your slide #s will be post ID, instead of slide-1, slide-2 <div class="content"> <?php if ( have_posts() ) : ?> <h2><?php single_cat_title('',true); ?></h2> <div> <ul> <?php $inc = 1; ...


1

Just an addiction to @KrzysiekDróżdż answer. When viewing a specific post status the url query string variable 'post_status', is set to the name of the status, so you can use $_GET['post_status'] to narrow the effect of @KrzysiekDróżdż code only for pending posts: function my_edit_per_page( $result, $option, $user ) { $status = filter_input( INPUT_GET, ...



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