Unique sequential reservation code

One solution among others : In a plugin, you create an option on it’s activation in order to store your sequence number : /* Plugin Name: Reservation Increment Description: test */ /** * * Name : myplugin_activate * Description : Activation function * * @params * @return * **/ function myplugin_activate() { update_option(‘reservation_increment’,3000); } register_activation_hook( … Read more

Redirect from “private” page and functions.php which tag add to add_action()?

The WordPress Global You should try this: function redirect_private_content() { global $wp_query, $wpdb; if ( is_404() ) { $current_query = $wpdb->get_row($wp_query->request); if( ‘private’ == $current_query->post_status ) { wp_redirect( home_url(“https://wordpress.stackexchange.com/”) ); exit; } } } add_action( ‘template_redirect’, ‘redirect_private_content’, 9 );

Get page id or status by private pages?

Double check you’re using these functions correctly. Try collecting the results and output them in order to see what you’re working with. get_the_ID() and get_queried_object_id() are two good ways to get the current ID, so pass them to get_post_status(). $debug = array ( ‘get_the_ID’ => get_the_ID(), ‘get_the_ID_status’ => get_post_status( get_the_ID() ), ‘get_queried_object_id’ => get_queried_object_id(), ‘get_queried_object_id_status’ … Read more

Footer disappears when using the_content ( )

An important difference from the_content() is that get_the_content() does not pass the content through the ‘the_content’. This means that get_the_content() will not auto-embed videos or expand shortcodes, among other things. If you find yourself annoyed with formatting of the content, more specifically the added p-tags that WordPress puts into the content that you didn’t. Just … Read more

Override the function twentytwelve_scripts_styles in a child theme

If you want to remove the entire twentytwelve_scripts_styles function, you have to remove the action hook : remove_action( ‘wp_enqueue_scripts’, ‘twentytwelve_scripts_styles’ ); However, this code have to execute after the function is being hooked by Twenty Twelve code, and before the action is fired (because after it’s too late). The child theme functions.php file is loaded … Read more