Help with if/else loop [closed]

You arent clear where you want your else statement, so Ive added one for each of the if’s you included. <?php $post_type=”post”; // <– Post Type $tax = ‘temporada’; // <– Taxonomía $termino = get_terms($tax); $category = get_the_category(); $cat_name = $category[0]->cat_ID; if ($termino) { foreach ($termino as $temporada) { $args=array( ‘post_type’ => $post_type, “$tax” => … Read more

Incorrect posts displayed on category page

First of all, never ever make use of query_posts. It is not just slow and reruns queries, but it breaks pagination, page functionalities and the globals like $post on which some theme functionalities and plugins rely. If you really need to run custom queries (which is totally unnecessary in this case), make use of WP_Query … Read more

How to change data format in custom meta box field [closed]

EDIT You should be using date_create_from_format or its alias DateTime::createFromFormat() to convert on format to another. You can try the following $date = DateTime::createFromFormat(‘m-d-Y’, ’03-09-2015′); echo $date->format(‘d-m-Y’); This will convert 03-09-2015 to 09-03-2015 ORIGINAL ANSWER This is more a PHP question than WordPress question. You can simply use str_replace to change the / in your … Read more

Making product image in woocommerce invoice linkable [closed]

have you tried, add_filter(‘woocommerce_order_item_thumbnail’,’reigel_woocommerce_order_item_thumbnail’); function reigel_woocommerce_order_item_thumbnail($item) { global $order; $_product = $order->get_product_from_item( $item ); $item = ‘<a href=”‘ . esc_url( get_permalink( $_product->id ) ) . ‘”><img src=”‘ . ( $_product->get_image_id() ? current( wp_get_attachment_image_src( $_product->get_image_id(), ‘thumbnail’) ) : wc_placeholder_img_src() ) .'” alt=”‘ . __( ‘Product Image’, ‘woocommerce’ ) . ‘” height=”‘ . esc_attr( $image_size[1] ) . … Read more

Bad theme code – can you find the error?

OK, I’m just going to list things out as I go through. Some of what follows is stylistic feedback, some is security related, some is functional: <div class=”home-featured-block”> <?php $featured_block=$profitmag_settings[‘featured_block_one’]; $no_of_block=$profitmag_settings[‘no_of_block_one’]; I don’t know what the $profitmag_settings variable looks like, but either of these parameters could be unset. Instead of just assuming they exist, you … Read more

How to know email address of visitors to my wordpress website [closed]

I’m not sure if this is legal in all countries but you can send the emailadress back to you by adapting it in the link the user clicks to your website. e.g. The email they receive has a button that links to your website. the url of the button looks like this: <a href=”http://www.yourwebsite.com?email=”[email protected]””><img src=”button.jpg”></a> … Read more

Should I create a child theme for a parent custom theme? [closed]

I would definitely avoid using 2 different wordpress themes and instead code for a more responsive website with CSS mediaqueries. It has worked out very well for me on the WordPress websites I created. If you’re not familiar with media queries, here’s a very basic rundown. HTML — <div class=”box”>hello world</div> CSS — .box { … Read more

The plugin has been used here? [closed]

I am not sure what you are seeing there, the whole site seems to be just missing with “To change this page, upload your website into the public_html directory” error message. From the quick search on logo it seems to be coming from DirectAdmin control panel. No WordPress in sight…