Selecting An image from the Media LIbrary on the frontend
Selecting An image from the Media LIbrary on the frontend
Selecting An image from the Media LIbrary on the frontend
You can’t prevent comments_template() from making an SQL query. Well, you could maybe hook into the DB layer to prevent just that specific query, but that would be very cumbersome to do. If this is for a theme, you could just remove the call to comments_template() and replace it with your own function. comments_template() doesn’t … Read more
suppress_errors() hides errors during the database bootstrapping hide_errors() hides SQL errors
Andrew Bartel is on the right path, but the link doesn’t quite do what you want. For static PHP files to access WordPress core functionality you need to add this to the top of the PHP file: define(‘WP_USE_THEMES’, true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ ); (This … Read more
It seems that you are modifying directly the twentyfifteen_get_color_schemes() function on parent theme or redeclaring it on your child theme. You should avoid both cases. In the original code from twenty fifteen can see this: apply_filters( ‘twentyfifteen_color_schemes’, array(…..) ); That means that you can create a filter to add extra color schemes in this way: … Read more
I’ve recently written an affiliate plugin where i had to do pretty much the same stuff. Here’s a chopup of the relevant parts: To process the extra info you get from the registration form: add_action(‘user_register’, ‘my_handle_signup’, 10, 2); function my_handle_signup($user_id, $data = null) { $reg_ip = $_REQUEST[‘reg_ip’]; $referrer = $_REQUEST[‘referrer’]; if (isset($reg_ip) && isset($referrer)) { … Read more
You create your own comments_template, it can be a duplicate function of the default one, the only changes are the database queries anyway. But you need your own function as WP doesn’t help you with filters here. SO, name it my_comments_template(): $filter = mysql_real_escape_string($_POST[‘comment-filter’]); if(!empty($filter)) $filter = “AND (comment_content LIKE ‘%%{$filter}%%’ OR comment_author LIKE ‘%%{$filter}%%’)”; … Read more
To add the product image to the checkout review order page, you want to add the following into your functions.php file of your theme. function my_add_order_review_product_image( $product, $product_obj ) { $image = wp_get_attachment_image( get_post_thumbnail_id( $product_obj->post->ID ), ‘shop_thumbnail’ ); return $image . $product; } add_filter( ‘woocommerce_checkout_product_title’, ‘my_add_order_review_product_image’, 10, 2 ); This is utilizing the filter hook … Read more
Looking at your comment, photos and videos aren’t custom post types but actually categories. I’m changing my answer to reflect your comment. You can use pre_get_posts to exclude specific categories in your loop. You can achieve that with $query->set( ‘cat=-1,-2,-3′ ); This will exclude categories with ID’s 1, 2 and 3, and will only show … Read more
you must put name of input in your $_GET[]. <?php echo $_GET[‘firstname’]; ?> and also i think you must try $_POST[] <?php echo $_POST[‘firstname’]; ?>