stefanocps
Forum Replies Created
-
Forum: Installing WordPress
In reply to: captive portal for wordpresscaptive portal id used tò manage users that connect tò the wifi of a restaurant, a bar, an Airport…There Is a login Page where the user shall leave his mail or other personal data and the start tò surf.Those datas Will be used for mailing-list for example..
Forum: Developing with WordPress
In reply to: language selector before page openwith something lik epolylang i think i know..but with google translate i think i cannot see differences in the url
Forum: Developing with WordPress
In reply to: language selector before page openyes this is a solution i have though too..but one thing, If i use a plugin like google translate, how do i “pass” the information?
Forum: Fixing WordPress
In reply to: manage the blog postsbut i don’t want to use elementor, as i would need to upgrade to pro or install other optional plugins. I would like to use the wordpress builtin feature
Forum: Fixing WordPress
In reply to: code appear at bottom of pageok i have solved
i have put this last code outside the “body” part
Forum: Fixing WordPress
In reply to: code appear at bottom of pagemore
i get that error with this code in the “body” part of the function.php
<!-- add image rss--> function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS'); <!-- end add image rss--> <!-- add image old post --> function replace_image_url_with_tag($content) { if (in_category('arti-visive')) { // Replace 'your-category-slug' with your specific category slug $pattern = '/<p>(https?:\/\/[^<]*\/([^<]*\.(?:jpg|jpeg|png|gif)))/i'; $replacement = '<p><img class="post-featured-img" src="$1" alt="$2"></p>'; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter('the_content', 'replace_image_url_with_tag'); <!-- end add image old post -->
Forum: Fixing WordPress
In reply to: code appear at bottom of pagei realize now that the first function.php i have inserted is not correct..i post it again
<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_locale_css' ) ) { function chld_thm_cfg_locale_css( $uri ){ if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) ) { $uri = get_template_directory_uri() . '/rtl.css'; } return $uri; } } add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' ); if ( !function_exists( 'child_theme_configurator_css' ) ) { function child_theme_configurator_css() { wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'hello-elementor','hello-elementor','hello-elementor-theme-style','hello-elementor-header-footer' ) ); } } add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 ); // END ENQUEUE PARENT ACTION // AGGIUNGI CODE ALL HEADER function analytics_code() { ?> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-NXJHDX6G');</script> <!-- End Google Tag Manager --> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-TVE4YLQBFF"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-TVE4YLQBFF'); </script> <meta name="google-site-verification" content="rW9y4P4RkRL3iJ1sdBnJW417VY4xJSInF2aiJlB5FeQ" /> <?php } add_action('wp_head', 'analytics_code', 999); // FINE AGGIUNGI HEADER // AGGIUNGI CODE ALL BODY function body_code() { ?> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NXJHDX6G" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <meta name="google-site-verification" content="rW9y4P4RkRL3iJ1sdBnJW417VY4xJSInF2aiJlB5FeQ" /> <!-- add image rss--> function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS'); <!-- end add image rss--> <!-- add image old post --> function replace_image_url_with_tag($content) { if (in_category('arti-visive')) { // Replace 'your-category-slug' with your specific category slug $pattern = '/<p>(https?:\/\/[^<]*\/([^<]*\.(?:jpg|jpeg|png|gif)))/i'; $replacement = '<p><img class="post-featured-img" src="$1" alt="$2"></p>'; $content = preg_replace($pattern, $replacement, $content); } return $content; } add_filter('the_content', 'replace_image_url_with_tag'); <!-- end add image old post --> <?php } add_action('wp_footer', 'body_code', 999); // FINE AGGIUNGI BODY
so this is the one i have now, and it gives me the error
This is the function.php without my code
<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_locale_css' ) ) { function chld_thm_cfg_locale_css( $uri ){ if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) ) { $uri = get_template_directory_uri() . '/rtl.css'; } return $uri; } } add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' ); if ( !function_exists( 'child_theme_configurator_css' ) ) { function child_theme_configurator_css() { wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'hello-elementor','hello-elementor','hello-elementor-theme-style','hello-elementor-header-footer' ) ); } } add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 ); // END ENQUEUE PARENT ACTION // AGGIUNGI CODE ALL HEADER function analytics_code() { ?> *** mycode *** <?php } add_action('wp_head', 'analytics_code', 999); // FINE AGGIUNGI HEADER // AGGIUNGI CODE ALL BODY function body_code() { ?> *** mycode *** <?php } add_action('wp_footer', 'body_code', 999); // FINE AGGIUNGI BODY
- This reply was modified 6 months, 1 week ago by stefanocps.
Forum: Fixing WordPress
In reply to: code appear at bottom of pageerror
- This reply was modified 6 months, 1 week ago by stefanocps.
- This reply was modified 6 months, 1 week ago by stefanocps.
Forum: Fixing WordPress
In reply to: code appear at bottom of pagethis is my function.php
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = ‘‘ . get_the_post_thumbnail( $post->ID, ‘medium’, array( ‘style’ => ‘margin-bottom: 15px;’ ) ) . ” . $content;
}
return $content;
}
add_filter(‘the_excerpt_rss’, ‘featuredtoRSS’);
add_filter(‘the_content_feed’, ‘featuredtoRSS’);function replace_image_url_with_tag($content) {
if (in_category(‘arti-visive’)) { // Replace ‘your-category-slug’ with your specific category slug
$pattern = ‘/(https?:\/\/[^<]\/([^<].(?:jpg|jpeg|png|gif)))/i’; $replacement = ‘
‘;
$content = preg_replace($pattern, $replacement, $content);
}
return $content;
}
add_filter(‘the_content’, ‘replace_image_url_with_tag’);<?php
}
add_action(‘wp_footer’, ‘body_code’, 999);// FINE AGGIUNGI BODY
Forum: Fixing WordPress
In reply to: error when adding code tu function.phpgreat, they both work. is there a way to chack that the code i have inserte dis really fetched?
Forum: Fixing WordPress
In reply to: error when adding code tu function.phpthat code works! how can i check if the code for analytics, the tyag i hav set…are working?
Forum: Fixing WordPress
In reply to: error when adding code tu function.phpok thank you i’ll try
and for body?
Forum: Fixing WordPress
In reply to: error when adding code tu function.phpbut if i copy ALL the code, this file will entirely replace the original header.php, and when th eoriginal.php will be updated..i
will not get update on my site?
Forum: Fixing WordPress
In reply to: error when adding code tu function.phpso this is not a solution
unlesss i can do that in the child header.php and footer.php
- This reply was modified 6 months, 2 weeks ago by stefanocps.
Forum: Installing WordPress
In reply to: insert code in header and bodytried several php version..always error