How to rotate the header image per day?

<div id=”header”> <?php mt_srand((int)date(‘z’)); $headers=glob(PATH_TO_FILES .’/*.jpg’); $header=mt_rand(0,count($headers)-1 ); ?> <img id=”header-image” `src=”https://wordpress.stackexchange.com/questions/5232/<?php echo URL_TO_FILES .”https://wordpress.stackexchange.com/”.basename($headers[$header]); ?>” alt=”header” /> </div> replace your current header with this. I will of course help you implement this further if you need help. (or if you need the code explained)

Get category ID in “archive-product.php”

Normally this should work with get_queried_object_id(). Anyway, as I don’t know what Woo exactly does to the query, this can be as well wrong, as the API function references to the object that is currently queried. And this is the object from the last query. So you might also do the following: Disclaimer: The below … Read more

How can I include PHP-Code to my post?

You can edit the single.php and/or content-single.php files in your theme. Then it depends what you mean by “some”. You could apply some conditions to your code (only certain categories, certain tags, certain specific post IDs only, etc.) You could also create a custom post type “myspecialposts” and create single-myspecialposts.php (codex)

Add .html extension to custom post type taxonomies

I’ve tested your first attempt with using a rewrite rule it works add_action(‘init’, ‘add_html_ext_to_custom_post_type_taxonomies’); function add_html_ext_to_custom_post_type_taxonomies() { add_rewrite_rule(‘^product_cat/(.+)\.html’, ‘index.php?product_cat=$matches[1]’, ‘top’); } but you have _ not – had you noticed this as you give your example as www.mydomain.com/product-category/product-category-name.html If its not a mistake it might be you have another rule conflicting with it? and also … Read more

File Storage Plugin (For Individual Users)?

Hi @inkedmn: What you are looking for sounds taylor-made for Amazon S3 as a hosted file service to complement your client’s web hosting. It’s incredibly cheap (my S3 bill is currently US$0.01 per month, but only for a few files) and has all sorts of content protection features like special expiring URLs and so on. … Read more

Execute a function using ajax

<div id=”asinform”> <form id=”productpreview” action=”#”> <input type=”text” id=”asin” name=”asin” value=”” placeholder=”Enter ASIN”/> <input type=”hidden” name=”asin_form_post” value=”1″/> <input type=”submit” value=”Preview”/> </div> <div id=”asinpreview”> <!– Preview goes here –> </div> <script type=”text/javascript”> if ( typeof jq == “undefined” ) var jq = jQuery; jq(document).ready( function() { jq(“#productpreview”).submit(function() { var asin = jq(“#asin”).val(); jq.post( ajaxurl, { action: ‘amazon_product_preview’, … Read more

Adding a Wizard to My Plugin

That’s WordPress API and the proper tool to use for this is register_activation_hook which fires right after your plugin activation, or after_setup_theme if you were doing this work for a theme. Here’s an example use, the code should be placed in the main plugin loader file, or if in a sub-directory then provide a path … Read more