Can’t remove menu items added by plugin

I’ll assume you’re calling it in your functions.php file? If that’s the case, likely the plugin is adding the menu item after you’re call is being called. Try placing it in the admin_init() hook, at the very end. if ( ! function_exists( ‘remove_wp_menu_items’ ) ) { function remove_wp_menu_items() { remove_submenu_page( ‘themes.php’, ‘theme-editor.php’ ); } } … Read more

How to change the menu color

Is this the answer you’re looking for? Go to your .css file and replace this #access { background: linear-gradient(rgb(37, 37, 37), rgb(10, 10, 10)) repeat scroll 0% 0% transparent; box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4); clear: both; display: block; float: left; margin: 0px auto 6px; width: 100%; } With this #access { background: … 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

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.

reorder a WP_Query, using a dropdown

I guess the problem is $qry = new WP_Query(array(‘category_name’=>$GLOBALS[‘city’],’order’=>$orderby)); Let’s just say $orderby is orderby=title&order=ASC Then the order argument of WP_Query will be like this: ‘order’=>’orderby=title&order=ASC’ However, order argument only accepts: ASC and DESC. You should do somethings like this: WP_Query(‘category_name=”.$GLOBALS[“city’].’&’.$orderby);

Path for contact form file

You could put both the form and processing logic in the same file and submit the form to the same page by omitting the action attribute. Check $_POST vars to see if the form has been submitted and do your processing, otherwise display the form. if( isset( $_POST[‘somevar’] ) ) : // process submission else … Read more

Remove the_content From Loop

I don’t see anything that would cause the_content() to display in your code. Chances are, the template file you are editing is NOT the one being used on the page/archive you are checking. Add this to the top of your template files… <!– Template: <?php echo __file__; ?> –> Now, in your web browser view … Read more

Changing 2011 theme header image based on user dropdown

I had to take information from both of your posts to be able to come with something. Try replacing <img src=”https://wordpress.stackexchange.com/questions/89211/<?php header_image(); ?>” width=”<?php echo $header_image_width; ?>” height=”<?php echo $header_image_height; ?>” alt=”” /> width <?php if (!(isset($_POST[“styles”]))) { //if post not set (first visit) if ($_COOKIE[“chosenStyle”] == “night”) { echo ‘<img src=”‘.get_template_directory_uri() . ‘/images/headers/SomethingOriginalTheMoonAndStars.png” width=”1000″ … Read more

How to echo a different field if another field is empty?

You might try to replace the foreach( $myCarousel as $carousel ) with: foreach($myCarousel as $carousel){ $myimg = get(‘projectdetails_image’,1,$carousel); if ( !$myimg ) { // use this if you want to show a default image when no image is available in the post $myimg = get_template_directory_uri().’/images/default_banner.jpg’; } if ( $myimg ) { echo “<div class=”item”.( $counter … Read more