Hello sprockettechweb,
Could you please specify and let us know what changes you’re trying to make?
[ Signature deleted ]
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
@gejay Thanks for the great support but please lose the signature. That’s prohibited in these forums as it’s been horribly abused in the past by others.
Thanks!
Styled Themes Support.
Yes, bad people ruin it for others. No, I’m not kidding. Please refrain from that.
https://wordpress.org/support/guidelines/#avoid-signatures
I added the above function. It should remove the website field from the comment form.
Thanks for the info @jdembowski !
And sprockettechweb,
Could you please provide us the reference to your child theme? Or please activate the child theme and let us know if there is no any issue associated to the child theme you’re using.
Best Regards,
The child theme is active? The only issue I’ve encountered is this one with the function not working in the child functions.php Other functions seem to work fine.
Hello sprockettechweb,
I’m afraid your website still shows the parent theme while detecting from our end.
Please share us the structure of your child theme’s functions.php file.
Thanks!
Strange. Here’s the 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_parent_css’ ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’, array( ) );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’, 10 );
// END ENQUEUE PARENT ACTION
//hide website field in comment form
function remove_website_field( $fields ){
if(isset($fields[‘url’]))
unset($fields[‘url’]);
return $fields;
}
add_filter( ‘comment_form_default_fields’, ‘remove_website_field’ );
//hide login ID from blog posts
add_filter( ‘request’, ‘wpse5742_request’ );
function wpse5742_request( $query_vars )
{
if ( array_key_exists( ‘author_name’, $query_vars ) ) {
global $wpdb;
$author_id = $wpdb->get_var( $wpdb->prepare( “SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key=’nickname’ AND meta_value = %s”, $query_vars[‘author_name’] ) );
if ( $author_id ) {
$query_vars[‘author’] = $author_id;
unset( $query_vars[‘author_name’] );
}
}
return $query_vars;
}
add_filter( ‘author_link’, ‘wpse5742_author_link’, 10, 3 );
function wpse5742_author_link( $link, $author_id, $author_nicename )
{
$author_nickname = get_user_meta( $author_id, ‘nickname’, true );
if ( $author_nickname ) {
$link = str_replace( $author_nicename, $author_nickname, $link );
}
return $link;
}
Hello @sprockettechweb,
In your functions.php please add and check for the hook one for removing the website field only, otherwise we need to investigate it further.
Let us know.
Thanks!
Sorry, I’m not sure I understand. Do you want me to add an “if( !function_exists” before the function?
Hello sprockettechweb,
Please add the following inside your child theme’s functions.php file and let us know;
add_action( 'after_setup_theme', 'fr_add_comment_url_filter' );
function fr_add_comment_url_filter() {
add_filter( 'comment_form_default_fields', 'fr_disable_comment_url', 20 );
}
function fr_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
Thanks!