Tag Info

New answers tagged

0

If you are using posts (rather than pages) and categories, you could do this by creating a custom archive template for all posts in the category books. As an example, this is the category page of "Image of the Week" on a photography blog. http://blog.keithberr.com/category/image-of-the-week/ In this case I copied category.php and saved it as category-21.php ...


1

Assuming that you're on a page template or a custom page template, the first thing you want to do is grab the current page ID, then use that ID to grab the children. Once you have the children, display the content for those children. Try using get_children(); You can also try get_page_children but for my example, I'm using get_children: <?php ...


0

The reason is when you execute this code setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH); It will reset your post password cookie to blank '', so it just work once To solve this you need to assign the original cookie and extend the timeout, like this setcookie('wp-postpass_' . COOKIEHASH, $_COOKIE['wp-postpass_' . COOKIEHASH], time() + 60 * 5, ...


0

How about using a simple css solution hiding the <li>s you don't want to show at first or using jQuery to calculate the number of <li>s to show or hide prev/next set?


0

I registered a function in the save_post hook via add_action('save_post', 'my_function', 10, 3); In the function itself I did nothing, except logging for testing reasons, and the button still became disabled, once the autosave (and my function was triggered). My function was also called peridodically ~20-30s according to the logs. I deregisterd my ...


1

WordPress uses sanitize_title to create the URL-friendly version of titles for use as post slugs, which has sanitize_title_with_dashes hooked to the sanitize_title filter. You can see sanitize_title in use in source for wp_insert_post here, and sanitize_title_with_dashes in source here.


0

Wow, no I didn't, but it makes me feel so much better about the solution I did come up with. Thanks for that reference. Again, the idea is just to programmatically create a path/url in a plugin for a WordPress site (like, "[mysite]/mypath"), and then load an arbitrary html or php file. In case anyone else is looking for something similar, this works for me ...


0

There are two things you need to keep in mind. In WordPress you have taxonomies and terms. For instance Category is a taxonomy, and let's say Portfolio is a term belonging to the "Category" taxonomy. What the code you just posted does is to take all the terms of the "faq_category_1" taxonomy and print all those values as a menu at the top. Then it makes ...


1

You can add OR conditions like this. <?php if ( is_front_page() || is_archive() || is_search() ) {?> <div>Flash Gordon</div> <?php } ?>


3

You are deleting all pages with that code because you are triggering the function wp_delete_post(). You should build the url to delete the page(or post) like this: $delLink = wp_nonce_url( get_bloginfo('wpurl') . "/wp-admin/post.php?action=delete&post=" . $page->ID, 'delete-post_' . $page->ID); So your code should be: $pages = get_pages(); ...


2

order is a reserved term, the best - I know of - overview over those can be found here: Codex: register_taxonomy() - Reserved Terms. The list is in it's relevance not restricted to taxonomies. The introduction to it does make it clear(er) why: Avoiding the following reserved terms is particularly important if you are passing the term through the $_GET or ...


2

This is actaully a naming clash. Wordpress uses the word order in its core as a sorting function, and is also a reserved name that should not be used by themes or plugins Changing your custom post type name to orders will fix your problem


2

You probably have an action to 'pre_get_posts' that it's excluding the page post-type. Paste that code here, so we can help you.



Top 50 recent answers are included