wp nav menu: show submenu below li item

It is possible to change the output of the menu, by creating a new menu Walker. I wouldn’t recommend this solution, however, since you’re attempting to do something that’s actually invalid HTML – the ul tag should only have li tags inside it, never anything else. I know it’s possible to create the solution you’re … Read more

conditional: if is page, and all subpages

Use get_ancestors to get the page parent, then check against that value instead of checking against the name. $ancestors = array(); $ancestors = get_ancestors($post->ID,’page’); $parent = (!empty($ancestors)) ? array_pop($ancestors) : $post->ID; if (!empty($parent)) { switch ($parent){ case 1 : // menu for parent page ID 1 break; case 2 : // menu for parent page … Read more

How to add 3 weeks to the_time() function

You should use get_the_time() and not the_time(). First one returns time and second one echoes it. I don’t think you should do this in JS though (there is no need to, and users can always block JS and see this image anyway). Your code could look something like this (it’s in PHP): if ( strtotime( … Read more

select a single val though a table in wordpress

Use the method get_var() instead. I’ve also tidied up your code (if you’re gonna use double quotes, take advantage of them!) & added data escaping with the handy prepare() method. global $wpdb; $cat_id = $wpdb->get_var( $wpdb->prepare( “SELECT category_id FROM {$wpdb->prefix}awpcp_categories WHERE category_name = %s”, $ad_cat ) );

How to add videos on my home page slider?

From the GPP Slideshow description: The GPP Slideshow plugin for WordPress allows you to create minimalist image slideshows… This plugin is built to only handle image slideshows, so I seriously doubt it could easily handle non-image content such as videos. You’re much better off moving on to a slideshow that is built to handle multiple … Read more

Trying to change image funtion from enlarge image to redirect to amazon website

The call to rel=”prettyPhoto” is what makes the lightbox popup the image. If you remove that the lightbox will no longer popup. Now as far as redirecting the user straight to the product page on Amazon, you need to change; href=”https://wordpress.stackexchange.com/questions/104566/<?php get_image_url(); ?>” to… href=”https://wordpress.stackexchange.com/questions/104566/your_link_to_amazon_product_page_jere” I don’t know where you are storing that link, if … Read more

How can I tell which of my pages are single-view pages?

First off, take a look at Conditional Tags in general. I am trying to understand what the is_singular() function does. Straight from the codex: “This conditional tag checks if a singular post is being displayed, which is the case when one of the following returns true: is_single(), is_page() or is_attachment().“ What I really need to … Read more