Forum Replies Created

Viewing 15 replies - 16 through 30 (of 173 total)
  • Thread Starter Bri

    (@tinnyfusion)

    Hmm very odd as my language is set to English UK in the admin backend. Not sure what else could be causing this as I’ve tested with all plugins disabled and only this snippet running…

    Thread Starter Bri

    (@tinnyfusion)

    Hmm, well it isn’t my local dev environment as I just added the script to my live site and it is the same there.

    My host is currently running Apache, PHP 7.4.33 and MySQL 5.7.44

    Thread Starter Bri

    (@tinnyfusion)

    Ok, I removed every single function and filter from my child themes functions.php file (except for the one we are talking about) and disabled all plugins except for GenerateBlocks and it still shows like this:

    This was while using the following code:

    // Change 'X thoughts on POST TITLE' in comment section (GeneratePress specific)
    add_filter( 'generate_comment_form_title', function(){
    	   $comments_number = get_comments_number();
    		return sprintf(
    			esc_html(
    				/* translators: 1: number of comments, 2: post title */
    				_nx(
    						'%1$s Comment on “%2$s”',
    						'%1$s Comments on “%2$s”',
    						$comments_number,
    						'comments title',
    						'generatepress'
    				)
    			),
    			number_format_i18n( $comments_number ),
    			get_the_title()
    		);
    });

    Could this be something to do with my local environment? I am currently testing this locally with WordPress 6.5.2 using Apache, PHP 8.1.23 and MySQL 8.0.16.

    Thread Starter Bri

    (@tinnyfusion)

    No worries and thank you for the mention in the update notes.

    Thread Starter Bri

    (@tinnyfusion)

    Thank you both. I will take a look tomorrow and report back after I’ve done as you have suggested.

    Thread Starter Bri

    (@tinnyfusion)

    Hi Ying,

    I have the following three snippets, although I do not see how these could interfere:

    // Disable comments on media & attachments
    if( !function_exists( 'ctm_disable_comments_on_attchments' ) ){
    	function ctm_disable_comments_on_attchments( $open, $post_id ) {
    		$ctm_post = get_post( $post_id );
    		if( $ctm_post->post_type == 'attachment' ) {
    			return false;
    		}
    		return $open;
    	}
    	add_filter('comments_open', 'ctm_disable_comments_on_attchments', 10 , 2 );
    }
    
    // Remove all links (<a href="#">...</a>) from WordPress comments
    remove_filter('comment_text', 'make_clickable', 9);
    
    // Disable Website/URL field from WordPress comments form
    add_filter('comment_form_field_url', '__return_false');

    Thank you for taking the time to look in to this.

    Thread Starter Bri

    (@tinnyfusion)

    Thanks for your reply. I don’t fully understand how text domain and translation has anything to do with my question.

    Please provide a working example based on the code I posted.

    cheers

    Thread Starter Bri

    (@tinnyfusion)

    Thanks Leo

    Thread Starter Bri

    (@tinnyfusion)

    Hi Leo,

    Thank you for your help. I updated my code to yours but I then also had the comma delimiter between each tag and category.

    To fix this I had to remove the following CSS:

    /* remove comma delimeter - create flex */
    .tags-links, .cat-links {
        font-size: 0; 
        display: -webkit-box; 
        display: -ms-flexbox; 
        display: flex;
    }

    And add the following filter to my child themes functions.php file:

    // Remove seperating commas from between post meta categories and tags
    add_filter( 'generate_term_separator', function() {
        return ' ';
    } );

    All sorted now ??

    Thread Starter Bri

    (@tinnyfusion)

    I’ve just had a thought, as this is not going to be needed anywhere else other than the Tagline, rather than having to use the code you provided to change the HTML for the Tagline to include content:attr(data-text); I guess I could just use the following:

    p.site-description:after{
    	content: "DELIVER";
    	color: var(--accent);
    	transform:translateX(-100%);
    	position:absolute;
    }

    What do you think, is this a better approach?

    Thread Starter Bri

    (@tinnyfusion)

    Hi David,

    With your function and a few minor tweaks to the CSS it now works exactly as required without the need to add any CSS to the WordPress Tagline field from the admin backend.

    My SEO lives to see another day ??

    Thank you so very much (again).

    Now with the issue that has been highlighted with the Tagline field being able to accept code. Do you think this needs mentioning in the WordPress forums to suggest this vulnerability be fixed?

    Bri

    Thread Starter Bri

    (@tinnyfusion)

    I’m currently on my phone at the min so won’t be able to add the snippet and experiment until later today. However thank you for the explanation. I knew what I wanted to achieve and obviously managed to fudge it in a hacks kinda way haha.

    Seems we may have discovered a bug with WordPress too if the tagline shouldn’t be able to accept html!

    As for getting this to work as intended then I’m assuming I’ll have to also adjust my CSS too, making sure it’s pointing to a paragraph tag as opposed to the H5 one and also set a font size too?

    Thread Starter Bri

    (@tinnyfusion)

    To clarify, this is my CSS from my child themes style.css:

    /* Site Logo START */
    .site-logo {
        position: relative;
        top: -12px;
    }
    /* Site Logo END */
    
    
    /* Site Title START */
    .main-title {
    	position: relative;
        left: -10px;
    	width: 100%;
        max-width: 960px;
        margin: 0 auto 1px;
        transform: rotate(-3deg);
        color: #222222;
        font-size: 3rem;
        line-height: 3rem;
        text-shadow: 0 1px 0 rgb(255, 255, 255),
                     0 0 5px rgba(0,0,0,.05),
                     0 1px 3px rgba(0,0,0,.2),
                     0 3px 5px rgba(0,0,0,.2),
                     0 5px 10px rgba(0,0,0,.2),
                     0 10px 10px rgba(0,0,0,.2),
                     0 20px 20px rgba(0,0,0,.3);
    }
    
    @media screen and (max-width: 480px) {
    	p.main-title a {
    		position: relative;
    		left: 10px;
    		word-break: normal;
    		font-size: 90% !important;
    	}
    	.site-logo {
    		display: none;
    	}
    }
    /* Site Title END */
    
    /* Site Tagline START */
    /* NOTE: Set Tagline to <h5 data-text="DELIVER">DESIGN | CREATE | DELIVER</h5> */
    h5:after{
    	content:attr(data-text);
    	color: var(--accent);
    	transform:translateX(-100%);
    	position:absolute;
    }
    /* Site Tagline END */

    Then within the WordPress backend at Settings > General I have the following:

    <h5 data-text="DELIVER">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DESIGN | CREATE | DELIVER</h5>

    The only reason I did it this way is because of how I am targeting the last word of the tagline with data-text="DELIVER". If I can move the above H5 to my style.css then I would prefer this if possible but didn’t know how..

    Thread Starter Bri

    (@tinnyfusion)

    I’m not touching the core files of WordPress or GeneratePress. I have a child theme where my CSS is being entered in style.css

    The H5 was typed directly in to the tagline field within the backend, as were the non-breaking spaces.

    Thread Starter Bri

    (@tinnyfusion)

    Ahh ok. So rather than adding my custom H5 along with the non-breaking spaces I assume I could also move the other html from there too and have it all in my external styles.css too?

    The only reason I added the h5 directly in the tagline field of the WordPress backend was because I don’t know how to add the h5 programmatically.

    Still a lot to learn about CSS..

    Can you advise?

Viewing 15 replies - 16 through 30 (of 173 total)