<?php
/*
Plugin Name: modify easy watermark plugin
Description: Modify text size to put on image watermark.
Version: 1.0.0
Author:
Author URI:
License: No license
*/
namespace EasyWatermark\AttachmentProcessor;
defined( 'ABSPATH' ) || exit;
return;
\add_filter( 'easy-watermark/available-processors', 'EasyWatermark\AttachmentProcessor\extendedProcessor' );
function extendedProcessor() {
// \spl_autoload_register( function() {
class AttachmentProcessorGDExt extends AttachmentProcessorGD {
/**
* Applies text watermark
*
* @param Watermark $watermark Watermark object.
* @return mixed
*/
private function apply_text_watermark( $watermark ) {
echo 'rabotajet';
return;
$output_image = $this->get_output_image();
if ( ! $output_image ) {
return new WP_Error( 'gd_error', __( 'Could not create output image. Please check your server configuration.', 'easy-watermark' ) );
}
$font = Text::get_font_path( $watermark->font );
if ( ! $font ) {
/* translators: font name */
return new WP_Error( 'font_not_found', sprintf( __( 'Font "%s" could not be found. ', 'easy-watermark' ), $watermark->font ) );
}
$text_size = $this->calculate_text_size( $watermark->text_size, $watermark->text_angle, $font, $watermark->text );
$image_size = $this->get_input_image_size();
// correct iamge size
$color_rgb = $this->get_rgb_color( $watermark->text_color );
$color = imagecolorallocatealpha(
$output_image,
$color_rgb['red'],
$color_rgb['green'],
$color_rgb['blue'],
127 * ( 100 - $watermark->opacity ) / 100
);
if ( false === $color ) {
return new WP_Error( 'gd_error', __( 'Something went wrong while allocating text color.', 'easy-watermark' ) );
}
$offset_x = $this->compute_offset( $this->get_position( $watermark->alignment, 'x' ), $watermark->offset['x'], $image_size['width'], $text_size['width'] );
$offset_y = $this->compute_offset( $this->get_position( $watermark->alignment, 'y' ), $watermark->offset['y'], $image_size['height'], $text_size['height'] );
$result = imagettftext(
$output_image,
$watermark->text_size,
$watermark->text_angle,
$offset_x - $text_size['delta_x'], $offset_y - $text_size['delta_y'],
$color,
$font,
$watermark->text
);
if ( false === $result ) {
return new WP_Error( 'gd_error', __( 'Something went wrong while applying watermark text.', 'easy-watermark' ) );
}
return true;
}
}
// } );
return [
'gd' => [
'label' => __( 'GD', 'easy-watermark' ),
'class' => 'EasyWatermark\\AttachmentProcessor\\AttachmentProcessorGDExt',
],
];
}
]]>Me would like to edit the single product page so the add to cart button appear only in case the user is logged in, also, me would like to add a book appointment button. For this I thunk about edit the single-product/add-to-cart/external.php file, and wrap with a is_user_logged_in function so the button appears only when the user is registered
And also I was making some testing and I added a p with the text ‘hola mundo’ but I don’t see it in the page, the file now is this way:
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<form class="cart" action="<?php echo esc_url( $product_url ); ?>" method="get">
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
<p>Hola mundo</p>
<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $button_text ); ?></button>
<?php wc_query_string_form_fields( $product_url ); ?>
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
</form>
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>`
Could someone help me? I’m newbie
]]>.js
directory to my child theme, made the necessary changes to the options object but the theme is still loading the options from the main theme; not the child theme. Do i have to enqueue the .js
file in the child theme folder or something else???
]]>.elementor-999 .elementor-element.elementor-element-2991f4e .eael-feature-list-icon {
font-size: 9px;
padding: 5px;
}
however, these are overwritten by these rules:
.elementor-widget-eael-feature-list .eael-feature-list-items .eael-feature-list-item .eael-feature-list-icon-box .eael-feature-list-icon {
padding: .5em;
-webkit-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
font-size: 30px;
line-height: 1;
color: #818a91;
text-align: center;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
}
]]>add_action( ‘onepress_site_start’, ‘onepress_site_header’ );
if ( ! function_exists( ‘onepress_site_header’ ) ) {
/**
* Display site header
*/
function onepress_site_header(){
$header_width = get_theme_mod( ‘onepress_header_width’, ‘contained’ );
$is_disable_sticky = sanitize_text_field( get_theme_mod( ‘onepress_sticky_header_disable’ ) );
$classes = array(
‘site-header’, ‘header-‘.$header_width,
);
if ( $is_disable_sticky != 1 ) {
$classes[] =’is-sticky no-scroll’;
} else {
$classes[] =’no-sticky no-scroll’;
}
$transparent = ‘no-t’;
if ( onepress_is_transparent_header() ){
$transparent = ‘is-t’;
}
$classes[] = $transparent;
$pos = sanitize_text_field(get_theme_mod(‘onepress_header_position’, ‘top’));
if ($pos == ‘below_hero’) {
$classes[] = ‘h-below-hero’;
} else {
$classes[] = ‘h-on-top’;
}
?>
<header id=”masthead” class=”<?php echo esc_attr( join(‘ ‘, $classes ) ); ?>” role=”banner”>
<div class=”container”>
<div class=”site-branding”>
<?php
onepress_site_logo();
?>
</div>
<div class=”headerMenuBar”>
<ul class=”headerMenuUl”>
<?php
dynamic_sidebar(‘header-menu’);
?>
</div>
<div class=”header-right-wrapper”>
<?php _e(‘Menu’, ‘onepress’); ?><span></span>
<nav id=”site-navigation” class=”main-navigation” role=”navigation”>
<ul class=”onepress-menu”>
<?php wp_nav_menu(array(‘theme_location’ => ‘primary’, ‘container’ => ”, ‘items_wrap’ => ‘%3$s’)); ?>
</nav>
<!– #site-navigation –>
</div>
</div>
</header><!– #masthead –>
<?php
}
}
I want to override that function into my child theme. I have made a php file with the same name in child theme
add_action( ‘onepress_site_start’, ‘onepress_site_header’ );
function onepress_site_header(){
$header_width = get_theme_mod( ‘onepress_header_width’, ‘contained’ );
$is_disable_sticky = sanitize_text_field( get_theme_mod( ‘onepress_sticky_header_disable’ ) );
$classes = array(
‘site-header’, ‘header-‘.$header_width,
);
if ( $is_disable_sticky != 1 ) {
$classes[] =’is-sticky no-scroll’;
} else {
$classes[] =’no-sticky no-scroll’;
}
$transparent = ‘no-t’;
if ( onepress_is_transparent_header() ){
$transparent = ‘is-t’;
}
$classes[] = $transparent;
$pos = sanitize_text_field(get_theme_mod(‘onepress_header_position’, ‘top’));
if ($pos == ‘below_hero’) {
$classes[] = ‘h-below-hero’;
} else {
$classes[] = ‘h-on-top’;
}
?>
<header id=”masthead” class=”<?php echo esc_attr( join(‘ ‘, $classes ) ); ?>” role=”banner”>
<div class=”container”>
<div class=”site-branding”>
<?php
onepress_site_logo();
?>
</div>
<div class=”header-right-wrapper”>
<?php _e(‘Menu’, ‘onepress’); ?><span></span>
<div class=”headerMenuBar”>
<ul class=”headerMenuUl”>
<?php
dynamic_sidebar(‘header-menu’);
?>
</div>
<nav id=”site-navigation” class=”main-navigation” role=”navigation”>
<ul class=”onepress-menu”>
<?php wp_nav_menu(array(‘theme_location’ => ‘primary’, ‘container’ => ”, ‘items_wrap’ => ‘%3$s’)); ?>
</nav>
<!– #site-navigation –>
</div>
</div>
</header><!– #masthead –>
<?php
}
difference is I changed position of dynamic_sidebar()
I can’t override function. Nothing changes. Why?
]]>According to this article: https://www.jigoshop.com/documentation/theming-jigoshop/ it was possible to safely override the template files in Jigoshop 1.x by creating a ‘jigoshop’ folder within the WordPress theme folder and uploading the relevant files. Is it possible to do the same in Jigoshop eCommerce? I have followed the same logic but I can’t get it to work.
Many thanks for your help,
Oliver
Any help would be appreciated.
Thanks
]]>I am using a child theme and i have inserted the snippet from here:
https://presscustomizr.com/snippet/altering-adding-footer-credits/
into functions.php in my child theme – and i know that functions.php is read since the site crashes if i make a error in the code.
But nothing changes in my footer?
my snippet looks like this currenctly:
<?
add_filter(‘tc_credits_display’, ‘my_custom_credits’);
function my_custom_credits()
{
$credits = ”;
$newline_credits = ‘Customizr theme by Press Customizr Customiz’d by Kenneth Wood;
return ‘
<div class=”span6 credits”>
<p> © ‘.esc_attr( date( ‘Y’ ) ).’ ‘.($credits ? $credits : ”).’ ‘.($newline_credits ? ‘<br /> ‘.$newline_credits.’ ‘ : ”).'</p> </div>’;
}
?>
2. What is the correct html for getting the new stadard text – since it differs from the text in the snippet
/Kenneth