Form to Add Posts to Custom Post Type

posting from the front-end is a matter of displaying a form and processing it: form: <!– New Post Form –> <div id=”postbox”> <form id=”new_post” name=”new_post” method=”post” action=””> <!– post name –> <p><label for=”title”>Title</label><br /> <input type=”text” id=”title” value=”” tabindex=”1″ size=”20″ name=”title” /> </p> <!– post Category –> <p><label for=”Category”>Category:</label><br /> <p><?php wp_dropdown_categories( ‘show_option_none=Category&tab_index=4&taxonomy=category’ ); ?></p> … Read more

With WordPress themes, where do I store the images and files relatively?

Let me answer your question with a question: Are these images part of your template or for general purpose? The WordPress theme “Responsive” has images files all over its theme folder. The theme should be at yoursite.com/wp-content/themes/responsive. In that theme folder there are a few folders with images: The obvious “images”, also “icons” and “includes/images”. … Read more

Display random categories on the front page (Finding and Editing Theme Functions)

The real question here is: How do I find “TheirCode” which is responsible for this selection using tools such as firefox dev bar and the actual source? If you are referring to the HTML output/source, then for example on the official Storefront theme demo site, just right-click on the “Product Categories” heading or section and … Read more

Bestway To Define Theme and Plugin path and url

Do not use constants for that. Do not use global constants at all. There are two types of constants: class/interface constants and global constants. Constants in classes or interfaces are fine and sometimes useful. An overly simplistic example: interface Requirements { const MIN_PHP_VERSION = 5.4; public function php_is_good(); } class Theme_Requirements implements Requirements { public … Read more

How do I cleanly override a plugin’s CSS with a child theme?

If the plugins are correctly adding their styles via wp_enqueue_style, you simply need to dequeue them: function wpa_dequeue_style() { wp_dequeue_style( ‘plugin-style-handle’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpa_dequeue_style’, 100 ); Whether or not this works depends on how and where the plugins are adding their styles, so there’s no absolute answer without knowing specific methods the plugins … Read more