All WordPress scheduled posts are being published immediately
I’d check to make sure that the scheduled time is actually in the future – date and time. And check the time offset settings on your site are set to the proper time zone.
I’d check to make sure that the scheduled time is actually in the future – date and time. And check the time offset settings on your site are set to the proper time zone.
You should try and use the WordPress hierarchy instead of singe-cat-. Make your parent category template using category.php or category-{slug}.php , and then use the technique here, http://codex.wordpress.org/User:MichaelH/MyPlugins. Or for more options try this plugin, http://wordpress.org/extend/plugins/category-template-hierarchy/
add_action( ‘template_redirect’, ‘redirect_to_specific_page’ ); function redirect_to_specific_page() { global $post; $current_user = $post->post_author; if(!empty($current_user)){ $user_post_count = (int) count_user_posts( $current_user ); if ( is_page(‘butiktest’) && $user_post_count == 1 ) { wp_redirect( ‘enhytte’, 301 ); exit; } } } authorized user: $current_user = wp_get_current_user();
You can use post type conditional tag: if ( ‘post’ == get_post_type() ) Complete: function excerpt_count_js(){ if ( ‘post’ == get_post_type() ) { echo ‘<script>jQuery(document).ready(function(){ jQuery(“#postexcerpt .handlediv”).after(“<div style=\”position:absolute;top:0px;right:5px;color:#666;\”><small>Character limit = 150. Current characters: </small><input type=\”text\” value=\”0\” maxlength=\”3\” size=\”3\” id=\”excerpt_counter\” readonly=\”\” style=\”background:#fff;\”> </div>”); jQuery(“#excerpt_counter”).val(jQuery(“#excerpt”).val().length); jQuery(“#excerpt”).keyup( function() { jQuery(“#excerpt_counter”).val(jQuery(“#excerpt”).val().length); }); });</script>’; } return; } add_action( ‘admin_head-post.php’, ‘excerpt_count_js’); add_action( … Read more
I feel like such an idiot!! I was trouble-shooting this last night and I guess I removed the featured image for the news page…so, of course, the image wasn’t showing up! I added the featured image and the following code: <?php if(is_home()) { ?> <?php $page_for_posts = get_option( ‘page_for_posts’ ); echo get_the_post_thumbnail($page_for_posts, ‘large’); ?> <?php … Read more
“The Loop” is just a name given to the while (have_posts()): the_post(); loop used to iterate over an array of posts returned by WP_Query(). The other function used for querying posts is the get_posts() function, which returns a simple (non-extended) array which you can loop through with a foreach loop. I don’t think it matters … Read more
I think you just need to start the $count variable from 1 and not zero. You’ll get the opposite effect otherwise because 0 modulo 3 is 0. The first item of every 3 will be getting the class name.
Filter the content of post_class(): add_filter( ‘post_class’, function( $classes ) { if ( is_singular() ) return $classes; // now minus last mod time in seconds $diff = time() – mysql2date( ‘U’, $post->post_date ); if ( DAY_IN_SECONDS <= $diff ) $classes[] = ‘new-post’; return $classes; }); Now, in your loop, use post_class(), and you get an … Read more
If your theme uses wp post class function post_classes($classes) { global $post; $customMetaVariable = get_post_meta( $post->ID, ‘customMetaName’, true ); if($customMetaVariable == ‘desiredCustomMetaValue’){ $classes[] = ‘cssClassName’; return $classes; } } add_filter(‘post_class’, ‘post_classes’); then in your style.css you could use: .cssClassName{ background-color: red; } hence applying that class to all of the posts that contain your desired … Read more
You can consult this answer, but the instructions are a bit unclear, so I’ll clarify them myself here. On the old blog, export the posts using the standard WordPress import/export functionality. If you’re unfamiliar with that, see this link for more information: https://codex.wordpress.org/Importing_Content On the new blog, use the WP Importer to import the XML … Read more