How to delete specific element when it is not homepage?

If I’m understanding correctly, and the code you posted is the full contents of your post, one option would be to only keep the paragraph in the main content, and add the link as custom postmeta. You would then create a child theme and edit whichever places you want links – front-page.php for the homepage, … Read more

LinkedIn Share Post Button

Use this: <script type=”text/javascript” src=”http://platform.linkedin.com/in.js”></script><script type=”in/share” data-url=”<?php the_permalink(); ?>” data-counter=”right”></script>

custom fields anchor points php

What you wanna do is use the name attribute. <a href=”#my-anchor”>Link to the anchor</a> <p name=”my-anchor”>This is the anchor</p> Also, I would use something consistent, like the post/page slug to be able to link to each section. <?php global $post; ?> <div class=”guide-section” name=”<?php echo $post->post_name; ?>”> And then for your list use the slug … Read more

custom search query database in child theme

The text input names don’t match the $_POST keys you are looping. Using [] in the input name attribute is for handling multiple inputs, not multiple keys. Try replacing name=”search[batch_no]” and name=”search[rfid_chip_no]” with simply name=”search_batch_no” and name=”search_rfid_chip_no” and looping $_POST instead of $_POST[“search”]. Also you need to check the conditions match, as only code and … Read more

Woocommerce custom attributes list help

If I understand your question correctly: <?php global $product; $sizes = $product->get_attribute( ‘size’ ); $sizes = explode(“, “,$sizes); ?> <?php if($sizes[0]!=”){ // if product sizes are defined ?> <ul class=”list-group”> <?php foreach($sizes as $size){ ?> <li class=”list-group-item”><?php echo $size; ?></li> <?php } ?> </ul> <?php } ?>

How to make `wp-list-table` show the` custom-fields` I have in Custom-Post

Solved Situation: // Add the custom columns to the copas post type: add_filter( ‘manage_copas_posts_columns’, ‘set_custom_edit_copas_columns’ ); function set_custom_edit_copas_columns($columns) { //unset( $columns[‘author’] ); $columns[‘coluna_carta’] = __( ‘Carta’, ‘your_text_domain’ ); $columns[‘coluna_naipe’] = __( ‘Naipe’, ‘your_text_domain’ ); $columns[‘coluna_situacao’] = __( ‘Situacao’, ‘your_text_domain’ ); return $columns; } add_action( ‘manage_copas_posts_custom_column’ , ‘custom_copas_column’, 10, 2 ); function custom_copas_column( $column, $post_id ) … Read more

How to call a function from functions.php with ajax?

You mean need to display the custom code your ajax add to cart button right? . add this below code your current active function.php file add_action( ‘wp_ajax_woocommerce_before_add_to_cart_button’, ‘hello_world’, 10); add_action( ‘wp_ajax_nopriv_woocommerce_before_add_to_cart_button’, ‘hello_world’, 10); add_action( ‘woocommerce_before_add_to_cart_button’, ‘hello_world’, 10); function hello_world() { $var1 = ‘Hello World!’; echo $var1; echo “The time is ” . date(“h:i:sa”); }