[Solved] WooCommerce Checkout page customization [closed]

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

[Solved] How To Display Date (/Time/Author) In pages?

WordPress has some nifty functions which do this for you. You’ll need some experiences with HTML, CSS, PHP to style the output and understand what these functions do but the functions you’re looking for are: the_date() which displays the post date. the_author() which displays the author of the post. In your theme will most likely … Read more

[Solved] How to add nofollow on all external links without plugin?

This is how I would do it : 1/ create a filter to access the post content before it’s displayed on page. See http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2/ Inside your fonction called (ie : my_the_content_filter in the example from the Codex) adapt this code : https://stackoverflow.com/questions/5037592/how-to-add-rel-nofollow-to-links-with-preg-replace Cheers ! 1 solved How to add nofollow on all external links … Read more

[Solved] Template for custom post type shows all posts instead of just one

If the code for the ‘actual template’ you posted is in the single-people.php… you do not need any query at all! When you call the url mysite.com/people/firstname-lastname wordpress already know that you want to view that person, only search for a file that display it. Normally, wordpress, in this case, search for the file single-people.php … Read more

[Solved] How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]

You may use an action in the format woocommerce_YOUR_PRODUCT_TYPE_add_to_cart to reach the goal. Here is the example. The following code is for putting in functions.php, if you are writing a plugin. Please remember to change the callback. eg. you have a product type called Special, you want to add the add-to-cart template for it. add … Read more

[Solved] BuddyPress Xprofile check if user can view field [closed]

I found the answer to this question with support from the members from the BuddyPress forum. The function that I needed was xprofile_get_field_data(). Here my code: <?php $hidden_fields = bp_xprofile_get_hidden_fields_for_user(); ?> <?php if(xprofile_get_field_data(‘field_name’) && !in_array(xprofile_get_field_id_from_name(‘field_name’), $hidden_fields)) : ?> <p><?php echo xprofile_get_field_data (‘field_name’); ?></p> <?php endif; ?> solved BuddyPress Xprofile check if user can view field … Read more

[Solved] Page attribute template dropdown not displayed even the syntax is correct

If you’re wanting to enable the Page Template dropdown for a custom post type, you have to enable support for “page attributes” when you define your CPT. You should currently have something like register_post_type(‘foo’, array(‘labels’ => array( … ), ); You need to add ‘supports’: register_post_type(‘foo’, array(‘labels’ => array( … ), ‘supports’ => array(‘title’, ‘editor’, … Read more

[Solved] Customise Jetpack Publicize text

Just some general remarks: Why isn’t the following change working? $custom_message = get_the_title( $post->ID ) .”. $hash_tags; to: $custom_message = get_the_content( $post->ID ) .’ ‘. $hash_tags; Note that get_the_content() doesn’t take a post ID as an input parameter and it depends on global variables, like $pages that’s derived from $post->post_content (with some pagination adjustments), within … Read more

[Solved] Dynamic HTML not displaying at respective place

You’re getting the output there because dynamic_sidebar() displays/echoes the output (widgets in the specific sidebar), so the output is echoed right when the shortcode function is called, which is before the $data is actually echoed. And you can fix that using output buffering: Either append the output to $data: $data.='</div>’; $data.='<div class=”col-xl-4 col-lg-4 col-md-4 col-sm-12 … Read more