Get rid of “comment” field on non-blog pages [duplicate]
Edit the template file, such as page.php and remove the include or call to <?php comments_template(); ?>. What theme are you using?
Edit the template file, such as page.php and remove the include or call to <?php comments_template(); ?>. What theme are you using?
What you put doesn’t make much sense, as it turns a 1 step action, into a 4 step action Why not just put: $oferta = get_page_by_title( ‘Oferta’ ); $my_query = new WP_Query( array( ‘post_type’ => ‘page’, ‘post_parent’ => $oferta->ID ) );
By default, there is no feed for pages. So Feedburner doesn’t know if or when a page was created or updated. If you didn’t set up a custom feed for pages Feedburner will not get this information.
function add_js_one_col_wpse_107240() { if (is_page()) { $pobj = get_queried_object(); if(!empty(get_post_meta($pobj->ID,’one-col’,true)) { wp_enqueue_script(/* … */); } else { wp_enqueue_script(/* … a different script … */); } } } add_action(‘wp_enqueue_scripts’,’add_js_one_col_wpse_107240′); get_queried_object will get you the page information. It will be a WP_Post object on a “Page”. global $post should probably work too, but this is cleaner. Use … Read more
Check how many ancestors the page has via get_post_ancestors: // grandchild pages will have two or more ancestors if( 2 <= count( get_post_ancestors( $post->ID ) ) ){ echo ‘grandchild page’; }
You need only a bit of logic while setting the parent variable. After that is better using the standard wordpress function get_pages instead of using a raw $wpdb query. Then, once you use setup_postdata for the pages, you can use the standard template tags instad of echo the raw page object properties. Finally after the … Read more
This is because you haven’t mentioned post_type here and by default post_type is ‘post’ and hence it is missing the pages, add the below in your query ‘post_type’ => array( ‘post’, ‘page’ ) Like this $articles = new WP_Query( array( ‘showposts’ => -1, ‘tag’ => $tag, ‘meta_key’ => ‘date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, … Read more
You can get the ID of the front page via get_option( ‘page_on_front’ ). (See also: WordPress option reference.) From there, you can query the page object via get_post(): $frontpage = get_post( get_option( ‘page_on_front’ ) ); Then the content is in the $frontpage object: $content = $frontpage->post_content;
If your goal is to load the selected custom template for each page within the loop, then you’re actually pretty close to that. You’re getting the value of _wp_page_template, but then you’re not doing anything with that template, you’re just loading content-page.php for each of those pages with the line get_template_part( ‘content’, ‘page’ );. If … Read more
You need to use pre_get_posts hook. Paste this code to your themes functions.php file. add_action(‘pre_get_posts’, ‘wpse_pre_get_posts’); function wpse_pre_get_posts($q) { if( $q->is_main_query() && $q->is_tag() ) { $q->set(‘post_type’, array(‘post’,’page’) ); } }