Class variables not correct on page

When you write that code <?php $pageopi = new opi; ?> // 1. object created // 2. __construct is called // 3. init action hook is set but is never executed so is o_check method <?php echo $pageopi->mg; ?> At this stage, init hook was executed long time before $pageopi is created actually, when page … Read more

How to move the “create new account” higher in woocommerce

This can be done by customizing the form-billing.php template, just move this part: <?php if (!is_user_logged_in() && get_option(‘woocommerce_enable_signup_and_login_from_checkout’)==”yes”) : ?> //more code.. <?php endif; ?> right before this line: <?php do_action(‘woocommerce_before_checkout_billing_form’, $checkout); ?>

Display Custom Field Value on Admin Page Column

The main errors where the missing of the $post_ID parameter in page_template_field and using $custom_field_id instead of $post_ID. Anyway, this works and is simpler: add_filter(‘manage_pages_columns’, ‘column_page’); function column_page($defaults) { $defaults[‘column_template’] = ‘Page Template’; return $defaults; } add_action(‘manage_pages_custom_column’,’column_page_template’,10,2); function column_page_template($column_name, $post_ID) { if ($column_name == ‘column_template’) { $custom_field_values = get_post_meta($post_ID,’page_template’); if (!empty($custom_field_values)) { echo ‘<p> ‘. … Read more

How do I add image to the title of post?

Those are called Featured Images in WordPress. While creating a new post, on the right hand side, you will see a meta box which allows you to upload an image. The image uploaded is cropped and set as the featured image. More about it here: WordPress Featured Images