Deleting Certain terms from appearing on the front end as links

The function get_terms has a convenient $args parameter which allows you to customize your query to meet your needs; in your case, it would be something as simple as: $args = array( ‘exclude’ => array(1,2,3) ); $terms = get_terms(“testimonial_category”, $args); The array to exclude must contain the category ids of the categories you wish to … Read more

Javascript not loading on certain page

Looks like it is your if statement possibly. It’s kind of tricky to say “if it’s not this or if it’s not that, then I want this to happen”. Normally you have to negate and change the operator. Try <?php if (!is_home() && !is_front_page()) { ?> This says “I want this to run on every … Read more

How to integrate noimage picture in this code

Change this: else if ($widget[“image_from”] == “custom”) { $post_custom_id = get_post_meta($row->post_id, $widget[“image_custom”], true); $row->image = get_bloginfo(‘url’).”/scripts/timthumb.php?src=”https://wordpress.stackexchange.com/questions/106998/.get_bloginfo(“url’).”/wp-content/uploads/”.get_post_meta($post_custom_id,”_wp_attached_file”,true).”&amp;h=70&amp;w=55&amp;zc=1″; } To this: } else if ( ‘custom’ == $widget[‘image_from’] ) { $post_custom_id = get_post_meta( $row->post_id, $widget[‘image_custom’], true ); if ( get_post_meta( $post_custom_id, ‘_wp_attached_file’, true ) ) $row->image = get_bloginfo(‘url’) . ‘/scripts/timthumb.php?src=”https://wordpress.stackexchange.com/questions/106998/. get_bloginfo(“url’) . ‘/wp-content/uploads/’ . get_post_meta( $post_custom_id, ‘_wp_attached_file’, … Read more

Could use some help with Shortcodes

First of all… It’s a really poor quality code, I guess. You assume that there will be only one tabs widget on page (it’s recognized by HTML id param, so placing 2 widgets on same page would generate invalid HTML code). You also implement only one shortcode, which parses it’s content. But I don’t think … Read more

Don’t show certain div on front page?

I think japanworm do not want it on the frontpage, the code above let’s it display only on the frontpage. You can exclude something (if not) by putting an ! before the tag. What you want to say is: If it isn’t front page than display the form So it would actually be <?php if( … Read more

Mixing variables into an array when inserting values

You are creating a string …. $sql=””ft_num”=>””.$ticket[‘number’].'”,”booking_id”=>”‘.$ticket[‘booking’].'”‘; … but expecting it to operate as an array… array( $sql, ‘event_id’ => $event[‘id’], This has nothing to do with how WordPress does anything. This is pure PHP. You have literally created this: array( [] => “ft_num”=>”‘.$ticket[‘number’].'”,”booking_id”=>”‘.$ticket[‘booking’].'”, ‘event_id’ => $event[‘id’], You need to build the array dynamically. $dynargs … Read more

Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?

Couple points: The customize_register action hook actually passes your function the $wp_customize variable, you don’t need to declare it as the global. Just put it as the first argument in your function declaration. The reason your code doesn’t run on the front end of the site is that the customize_register action hook only runs when … Read more

Changing the color scheme based on the url visited

The Misconception get_site_url() retrieves the site_url option from the database, as set under General Settings in the administrative backend / wp-admin. If this is indeed the exact same wordpress installation it will always return the same thing, regardless of whether the location is reachable via one, two or five hundred domains. You might want to … Read more