add_theme_page is not working

You created the callback function and the function for adding the Theme page, but you also have to tell WordPress when to call your function my_plugin_menu. You can do this by hooking into admin_menu. add_action(‘admin_menu’, ‘my_plugin_menu’); This way WordPress knows that when it reaches the Scripts for admin_menu, it also has to execute your code, … Read more

get_post_custom_values not working

It most probably means that no custom post values have been retrieved for the key Description that you used. According to the Codex, Returns nothing if no such key exists, or none is entered. Try adding print_r($key_values); on the line just after get_post_custom_values(“Description”); and check if any value is retrieved. To skip this warning(when you … Read more

best way to communicate between php and jquery/javascript

At first, you’ll have to make a dropdown filled with your values from the database: <select id=”pakket”> <?php foreach ($allPakkets as $pakket) { echo ‘<option value=”‘.$pakket[‘id’].'”>’.$pakket[‘name’].'</option>’; } ?> </select> And a div to put results in: <div id=”results”></div> Now, we add a piece of javascript: jQuery(‘#pakket’).change(function(){ // when the dropdown changes… var newvalue = jQuery(‘#pakket’).val(); … Read more

Multilingual website suggestions

Will try to relate to this as a question, talking about the merits and such of the solutions. Quite limited, normally it would not change direction, however – you might add some javascript that will dynamically add the dir=”rtl” tags when appropriate You can do that, very high maintenance but might work best, depending on … Read more

WordPress not working locally

If you’re on OSX, look into MAMP. It’s developed with WordPress in mind and generally works without any further configuration. Just copy your files into the web root directory, set up an empty database, and install.

Saving Taxonomies to Post Revisions

WordPress only supports revisions for post content, not terms. To create a system that monitors changes in post-term relationships over time, you would have to write a plugin that explicitly handles that. If you’re interested in going down that route, you would probably need to use the save_post hook to save term data (saving as … Read more

URL prefix to include one PHP page

Try get_template_part(). For example, in your index.php template file: /** * Index template file */ /** * Include header */ get_header(); /** * Include arbitrary file */ get_template_part( ‘foobar’ ); This will include a template-part file, foobar.php, located in the Theme’s root directory.