Unable to pass variable to database
Never mind, I just took a few hours away from the script and then I found the culprit… I did mistype the $proprietate variable when I assigned it to the db field (which is set to not NULL)…
Never mind, I just took a few hours away from the script and then I found the culprit… I did mistype the $proprietate variable when I assigned it to the db field (which is set to not NULL)…
I think the answer is “it depends” — on how flexible and/or “slick” you want the solution to be. The quickest/easiest thing to do would be to create a custom post type (there are tried/true plugins out there that can help establish this) — and then in your theme functions.php (or in a very simple … Read more
(EDIT) Take the custom rules outside the # Begin WordPress (credit to Tim Malone) You can check if the file exists in the root and load it before the WordPress rules kick in: # check for a file, i.e register.php # load it if found and stop processing the rest of the rules with the … Read more
As milo stated, I need to use the post_class function to use the post_class filter. By adding <?php post_class(); ?> to the div in my loop I was then able to successfully modify the post class. Below is my full code containing the post_class filter and the post_class function. Reference: https://codex.wordpress.org/Function_Reference/post_class <?php //Call in the … Read more
I think it would be best to do a template override in Woocommerce. If by single you mean a page when viewing only one product then look at the single-product.php template. The directory it needs to located is: /public_html/wp-content/themes/your-theme/woocommerce/single-product.php. You can download the template overrides from woothemes.
You can get current user ID easily using get_current_user_id(). $usersid = get_current_user_id(); $activity = $_POST[‘activity’]; $reason = $_POST[‘reason’]; $explanation = $_POST[‘explanation’]; For your function f2user() you can change your code to this: $current_user = wp_get_current_user(); return $current_user->ID; According to wp_get_current_user() doc, if no user is signed in, $current_user->ID would return 0.
I actually solved this… here’s what you need to do if anyone needs to do something similar: SO, you can’t really query a site, but you can query pages on sites… so what I did was make a new page on the site where everything looked good, embed the shortcode, query that page and the … Read more
It’s a bad use of Query you may look at this post In this case use a secondary query with your own instance of WP Query. query_posts() is not recommanded here cause it overrides the main query. <?php $args = array( ‘post_type’ => ‘instrument’, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => 1, ); $my_query = new WP_Query( … Read more
this not perfect way to write inline java script , write java script into document ready event jQuerydocument ).ready(function() { jQuery( “.wc-proceed-to-checkout” ).css(“display”, “none”); });
If I understand your question correctly, I believe this is what you’re looking for: <div class=”postthumbnail”> <?php $usercrop = get_field(‘usercrop’); if ($usercrop) { $image = wp_get_attachment_image_src(get_field(‘usercrop’), ‘full’); ?> <img class=”post-thumbnail img-responsive postpic” src=”https://wordpress.stackexchange.com/questions/232716/<?php echo $image[0]; ?>” alt=”<?php echo get_the_title(get_field(‘usercrop’)) ?>” /> <?php } ?> </div> It checks the field and only displays the HTML if … Read more