Prevent duplicate pages from being added
you can use the same function simply hook it to the publish_page hook or any custom post type for that matter publish_{post type name} so just add : add_action(‘publish_page’, ‘clearDuplicatePosts’);
you can use the same function simply hook it to the publish_page hook or any custom post type for that matter publish_{post type name} so just add : add_action(‘publish_page’, ‘clearDuplicatePosts’);
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
The second parameter of register_taxonomy can accept a string or an array of post types, so simply add the page post type to that array, like so: function qc22_build_taxonomies() { register_taxonomy( “fullscreen-tags”, array( “fullscreen”, “page” ), array( “hierarchical” => true, “label” => __( “Fullscreen Tags” ), “singular_label” => __( “Skill Type” ), “rewrite” => array(‘slug’ … Read more
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
WordPress actually comes with pagination built in. I don’t believe there’s a button on the visual editor by default, but in HTML mode you should be able to insert <!–nextpage–> wherever you’d like a page break and it will work. Styling the pagination links would likely be the next step after that: http://codex.wordpress.org/Styling_Page-Links
Truncate the_content to your desired length, check if the last character is a < and remove it if so, then pass it to force_balance_tags, which will close any opened html tags.
What I want to do is create a “category page” for each category That would be category archive, not page. See category templates. As all of my “product detail pages” are pages, and not posts, I’m not sure how to set up my taxonomies. It would make sense to create custom post type for your … Read more
Do NOT edit core files! You can add to or override the default text by using a filter. Try taking a look at http://justintadlock.com/archives/2011/06/02/adding-contextual-help-to-plugin-and-theme-admin-pages
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
I suspect that the problem is that you’re using the default, fallback navigation menu instead of a defined, custom navigation menu. (The “Home” link you’re seeing is the default home link output by wp_page_menu().) Go to Dashboard -> Appearance -> Menus, to define and apply a custom navigation menu. By applying your static front page … Read more