WordPress page content outside WordPress

The alternative way. Problem with @david.binda solution is that: you have to hardcoding a lot of things, (manually write db credientials, table prefix..) You cannot use content filter (so if you have shortcode in your page, you will see some [something] instead of desired content..) sure you can load wordpress environment, but… Just yesterday I … Read more

get_post_meta() retrieves meta from a specific post on pages, not the page currently viewed

There is some other query which replaces the main post ID. Might be another widget, some strange plugin code or something else If you have no control over the context, collect the post ID earlier: add_action( ‘template_redirect’, ‘collect_post_id’ ); function collect_post_id() { static $id = 0; if ( ‘template_redirect’ === current_filter() && is_singular() ) $id … Read more

Why is get_pages() returning a boolean?

Historically I’ve had better luck using get_posts() over get_pages(). Especially in the case of a custom post type, I’d recommend using something like $args = array( ‘post_type’ => ‘home_section’, ); $hp_sections = get_posts( $args ); instead of using get_pages(). Reference get_posts() on the Codex

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

Can a user find a child page?

This is a shortcode you see there in the post/page content. It’s most likely displaying all the child pages (up to depth 1) of the current page. Shortcodes are very common, but you can’t see their output in the WordPress post/page editor, only on the front end where it’s generated via the do_shortcode() function. The … Read more

Remove Content edit box from ALL pages (not posts)

Found the following solution which works to remove the content editor from all “page” content. Just chuck it in the functions.php file add_action(‘admin_init’, ‘remove_textarea’); function remove_textarea() { remove_post_type_support( ‘page’, ‘editor’ ); }

No Appearance panel is shown

You are accessing your hosting server panel. There is no way you will find Appearance tab there. Go to this URL: http://yourdomain.com/wp-admin to access your WordPress Dashboard. You can view the Appearance section there.