I have a form in the bottom of this page (not the button on top), where I send a donation.
My goal is to change Stripe description for something like “Petit Magicien Conversion GAds | gclid=test213test”.
For this, I used this following function (in function.php) :
function stripe_custom_description($description) {
// Vérifier si le gclid est présent dans l'URL
if (isset($_GET['gclid']) && !empty($_GET['gclid'])) {
$gclid = sanitize_text_field($_GET['gclid']);
// Définir une nouvelle description seulement si le gclid existe
$description = "Petit Magicien Conversion GAds | gclid=" . $gclid;
}
// Retourner la description (modifiée ou originale)
return $description;
}
add_filter('give_payment_gateway_donation_summary', 'stripe_custom_description', 10, 1);
Even though there is a ?gclid=test213test in the URL, the end description in Stripe is not changing.
What can I do to solve this?
]]>I am trying – and failing – to apply some CSS to a default block through function.php for my custom block theme.
More precisely, I want to modify the style of the search bar block to adjust the padding in the input field, and remove the space between the field and the button.
In function.php, I added this code :
if ( ! function_exists( 'theme_setup' ) ) :
function theme_setup() {
wp_enqueue_block_style(
'widgets/search',
array(
'handle' => 'search-bar',
'src' => get_theme_file_uri( 'assets/css/search-bar.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_theme_file_path( 'assets/css/search-bar.css' ),
)
);
}
endif;
The search-bar.css file contains the following properties :
input.wp-block-search__input{
padding: 0px 18px;
border: solid 1px #8acb8a;
background-color: #8acb8a;
}
button.wp-block-search__button{
margin-left: 0;
}
(the border and background-color properties here are just there to make the changes more visible to me)
To my surprise, the custom CSS is applied to the block when viewed in the editor (https://i.ibb.co/vBMCBc3/editor.png), but not on the front-end (https://i.ibb.co/1bmKNVV/front-end.png). I was under the impression that it should be the opposite.
I can’t seem to make my attempts work here. The fact that it works in the editor makes me think that I am on the right path, but I don’t know what I am doing wrong. Any idea ?
]]>add_filter(‘mailpoet_newsletter_post_excerpt_length’, function() {
return 20; // Antal ord som ska visas som utdrag
}); but still the hole bloggpost is postet in the teaser what do I wrong?
When I am modifying the function.php file in the background, I will always report an error, which prevents me from modifying the code
How can I solve this problem
Thanks
]]>function update_billing_address_2_from_company( $order_id ) {
if ( pll_current_language() === 'he' ) {
$order = wc_get_order( $order_id );
$billing_company = $order->get_billing_company();
$first_name = $order->get_billing_first_name();
//because of a bug, overwrite billing addres_2
if (!empty( $billing_company)) {
$order->set_billing_address_2( $billing_company );
$order->save();
}
//set company name as first name
if (!empty( $first_name )){
$order->set_billing_company( $first_name );
$order->save();
}
}
}
add_action( 'woocommerce_checkout_update_order_meta', 'update_billing_address_2_from_company', 10, 1 );
]]>function my_checkout_update_user_meta( $user_id ) {
if(pll_current_language() == ‘he’)
{
$first_name_input = $_POST[‘billing_first_name’];
$billing_company_input = $_POST[‘billing_company’];
update_user_meta( $user_id, ‘billing_address_2’, $billing_company_input );
update_user_meta( $user_id, ‘billing_company’, $first_name_input );
}
}
add_action( ‘woocommerce_checkout_update_user_meta’, ‘my_checkout_update_user_meta’ );
function enqueue_fa_script() {
wp_enqueue_script('fascript','https://kit.fontawesome.com/8b5c83d55f.js') ;
}
add_action('wp_enqueue_scripts', 'enqueue_fa_script');
I got the kit code from font awsome website:
<script src="https://kit.fontawesome.com/8b5c83d55f.js" crossorigin="anonymous"></script>
my html code is :
<div class="header-section3">
direct bellen
</div>
<div class= "tel-icon">
<i class="fa-solid fa-phone-xmark"></i>
</div> </div>
the problem is it is not working I don’t anderstand why?
wat can be the error?
thanks