Tag Info

Hot answers tagged

8

Here is something i have laying around: <?php /* Plugin Name: Approve From preview Plugin URI: http://en.bainternet.info Description: Approve from privew is Plugin that lets yo approve posts (draft and pending) from the preview itself. Version: 0.1 Author: Bainternet License: Copyright 2012 Bainternet (admin@bainternet.info) This program is free ...


5

I think you can set your post to private to view it privately on the homepage. Once you change the visibility to private, the post or page status changes to "Privately Published" as shown. Private posts are automatically published but not visible to anyone but those with the appropriate permission levels (Editor or Administrator). See here. ...


4

Preface Once post preview is frontend, the comment form depends on how theme handle it. I will assume in this answer that the comment form is shown using the standard comment_form() function. The previous assumption isn't enough, in fact comment_form is probably the function in WordPress core with more hooks. There is almost an hook for every line. So what ...


4

You could use the conditional is_preview() to add a bit of extra content. For instance, you could put this at the very top of your single.php right after the header is called - or you could put it in your header.php file if you want it shown at the very top of the page: <?php if ( is_preview() ) { ?> <div>You're viewing a ...


4

You should install any program - for example MAMP - that allows you to use Apache and MySql. Then go to wordpress.org and download the latest copy of wordpress. Install it and upload your theme in the wp-content/themes folder.


3

I rarely deal with cookies and not sure about complete mechanics there, but here is basic working example of passing current user's cookies to retrieve preview page source: $preview_link = set_url_scheme( get_permalink( $post->ID ) ); $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); ...


3

Look somewhere after the "Loop" starts (it starts with <?php while( have_posts() ): the_post(); ?>) in your index.php file. Find <?php the_content(); ?> and change it to <?php the_excerpt(); ?>. If you don't want any content, just remove the_content() all together. If you're using a theme from wordpress.org, it would best to do this in a ...


3

Here's a way to do it without modifying the core: add_action('admin_footer','preview_same_window'); function preview_same_window(){ ?> <script type="text/javascript"> jQuery(function($){ jQuery('.preview.button').unbind().removeAttr('target'); setTimeout(function(){ ...


3

Draft previews Take a quick look at this chunk of core code in query.php which [Checks] post status to determine if post should be displayed. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php#L2658 if ( ! is_user_logged_in() ) { // User must be logged in to view unpublished posts. $this->posts = array(); } ...is what ...


2

I run through exact same issue. Later I come to know that custom post type I created was not public and hence it does not have 'Preview Changes' button visible. Prior version of Wordpress was displaying that button but it seems they have fixed it now. To fix it, make sure you set 'public' to 'true' in array of arguments you are passing to ...


1

It sounds like you need a second loop on your home page to call the 3 most recent posts. Try something like this: // Main home page content here <?php $my_query = new WP_Query( array( 'posts_per_page' => 3, 'nopaging' => true ) ); while ( $my_query->have_posts() ) : ( $my_query->the_post() ); ?> <div id="preview"> <div ...


1

Open the wp-config file and replace the line that reads define('WP_DEBUG', false); with: if ( isset($_GET['debug']) && $_GET['debug'] == '1' ) { define('WP_DEBUG', true); } elseif ( isset($_GET['debug']) && $_GET['debug'] == '2' ) { define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', true); } elseif ( isset($_GET['debug']) && ...


1

There is the handy is_preview function. So somewhere in your single.php. <?php if (!is_preview()) { // Show stuff that doesn't belong on a preview. }


1

The only way I found to make it work is to implement the 2nd patch suggested in this trac ticket I know it's a patch in the core files, but in the next version of WP (3.6), the change is supposed to be comited, so there shouldn't be any problems with updates. Edit Note/Disclaimer: The following mini-plugin was ripped out of Daniel Bachhubers "Edit-Flow" ...


1

I see your problem in the javascript. I've done something similar using the "on close" event of the wp.media object. You can use the "select event", as you are actually doing, but I would use "on select" event mainly for events within the modal window (but it is just preference, you can use the "on select" if you want). Here my suggested javascript code for ...


1

If I understand you goal correctly, then will you a select inside the Customizer, there list the Categories and the User can use this for save in your theme settings. If you will enhance the Customizer for categories, then use this class from this repo here. Include the file and enhacne the default class. You can easy implement a select for the categories ...


1

On your theme folder, open the index.php (or, home.php, or, front-page.php), and find, if there is a function named: the_content() Just change it to: the_excerpt() P.S.: If you can't find the_content() in the mentioned file, try searching content.php, and in this case, change it with caution. Because in theme TwentyTwelve, it's used with conditional ...



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