Add Filter to Ignore a Post/Page or a Number of Post/Pages

you can use pre_get_posts filter hook and set the post__not_in parameter of the query ex: function exclude_from_search_filter($query) { if ( !$query->is_admin && $query->is_search) { $query->set(‘post__not_in’, array(40, 9) ); // id of page or post } return $query; } add_filter( ‘pre_get_posts’, ‘exclude_from_search_filter’ );

How to control display of page lists on sidebar that doesn’t have childrens

I would try replacing your $children definition, using get_page_children() or get_children(): <?php global $post; $children = get_children( array( ‘post_type’ => ‘page’, ‘post_parent’ => $post->ID, ‘post_status’ => ‘publish’ ) ); if ( $children ) { // Code to list child pages goes here } ?> Also, wp_list_pages() will always return a string (either populated or empty), … Read more

Show specific page on main index instead of latest

This should work by putting the good IDs. The paged attribute is useless here as you’ll always show the same posts. <div id=”main_posts”> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(array( ‘showposts’ => 3, //’paged’ => $paged, ‘post_type’ => ‘page’, ‘post__in’ => array(1, 2, 3) // Your post IDs )); ?> <?php … Read more

Having a series of pages created based on records in a table with fields populating the pages

You can indeed query on post metadata, see Custom Field Parametersfor WP_Query in Codex. I would recommend against using a custom table. EDIT – Here’s an example query for all resorts with meta key vertical_feet between 2000 and 3000: $args = array( ‘post_type’ => ‘resort’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘vertical_feet’, … Read more

How to recover pages from site with only ftp? [closed]

The short answer is that your pages are stored in a database. So they are likely to be safe. It sounds like something else is broken with your site … please can you cut n paste any error message here What were you doing to break it? 1. If you recently updated a plugin or … Read more

Loading scripts on specific pages using PHP in footer.php

You should be using wp_enqueue_script rather than putting script tags directly in template files: function wpa61143_enqueue_scripts() { if( is_page( ‘home’ ) ) : wp_enqueue_script( ‘jcarousel’, get_template_directory_uri() . ‘/scripts/jquery.jcarousel.min.js’, array( ‘jquery’ ), null, true, ); elseif( is_single() ) : // enqueue scripts for single elseif( ! is_page_template(‘modelPages.php’) ) : // enqueue scripts for other endif; } … Read more