Search results to be only posts & children of page ID

The only way I could figure it out was to build a list of ID’s to exclude like this: /* * Hide some pages from search results */ function SearchFilter($query) { if ($query->is_search) { $exclude=”18,20,12,22,132,76,81,78,84,91″; // Get all children of #18 $pages = get_pages(‘post_parent=18’); foreach($pages as $child) { $exclude .= “,” . $child->ID; } $query->set(‘post__not_in’, … Read more

Hide links to pages that dont have any content

I think you would need to implode(‘,’,$excluded_pages) for things to work, $excluded_pages = array(); $all_pages = get_pages(); foreach ( $all_pages as $the_page ) { if ( ” == $the_page->post_content ) { $excluded_pages[] = $the_page->ID; } } wp_list_pages( array( ‘exclude’ => implode(‘,’,$excluded_pages) ) ); EDIT

Separate URL for a specific page

Uhm, nice question. Some hacking is required. Use pretty-permalinks on company site On the domain of the founder, do a URL-rewrite from http://www.founder-domain1.com to http://www.companysite.com/page-founder1 On the company site, use a custom menu with a custom URL: Founder Page -> http://www.founder-domain1.com. (If you cannot use a custom menu, create a link in your template) Of … Read more

Author page like wordpress answers

Take a look at Members List Plugin The Members Plugin allows you to create a post on your wordpress blog that lists all your wordpress members. When viewing the list of members you can also search through your members according to first name, last name, email address, URL or any other number of user meta … Read more

trying to add a author value in wp page links?

You check for <!–pageauthor:, but you expect it to start on the second character (1 === $has_part_title2) (you even have a typo there and left the 2 off). This will not work, because <!–pagetitle: is still part of that string (you don’t chop it off). You should either chop it off (do a substring in … Read more

Exclude child pages args array

There is not depth parameter for get_posts. See http://codex.wordpress.org/Template_Tags/get_posts You will need to check to see whether the page has a parent and display it if it does not have a parent. Once you are in the foreach loop add an if statement <?php if( !$post->parent ): ?> <li><a href=”https://wordpress.stackexchange.com/questions/26866/<?php the_permalink(); ?>” title=”<?php the_title(); ?>”> … Read more

$page = get_page_by_title CONTAINS

You should build a query using the WordPress database class. Place this in your functions.php file function get_page_by_title_search($string){ global $wpdb; $title = esc_sql($string); if(!$title) return; $page = $wpdb->get_results(” SELECT * FROM $wpdb->posts WHERE post_title LIKE ‘%$title%’ AND post_type=”page” AND post_status=”publish” LIMIT 1 “); return $page; } Use this in your theme: $page = get_page_by_title_search(‘Foo Bar’); … Read more

Static Website No Titles But Still Nav

Somewhere in your page.php template will be a tag containing the_title(), and that’s what you have to delete. In my WordPress theme, for example, the code looks like this: <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”entry”> <div <?php post_class(); ?>> <div class=”post-meta”> <h1><?php the_title(); ?></h1> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)