Forum in maintenance, we will back soon 🙂
Code Snippets
Replace WordPress Logo on Login Page
<?php add_filter( 'login_head', function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = 'https://wpcode.com/wp-admin/images/wordpress-logo.svg'; if (function_exists('get_custom_logo')) { $custom_logo_id = get_theme_mod('custom_logo'); $custom_logo = esc_url(wp_get_attachment_image_src( $custom_logo_id , 'full' )[0]); } $logo_width = 84; $logo_height = 84;
Custom User Greeting Shortcode
<?php function custom_greeting_shortcode() { if (is_user_logged_in()) { $current_user = wp_get_current_user(); return 'Welcome, ' . esc_html($current_user->display_name); } else { return 'Welcome, Anonymous User'; } } add_shortcode('custom_greeting', 'custom_greeting_shortcode');
AIOSEO Disable User Profile Tab Filter
<?php add_filter( "aioseo_user_profile_tab_disable", "__return_true" );
Disable Application Passwords Except Super User
<?php $current_user = wp_get_current_user(); if ($current_user->has_cap('delete_users') != true) { add_filter( 'wp_is_application_passwords_available', '__return_false' ); }
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
Thanks for sharing.
I am working on a code snippet library : https://learnwithhasan.com/codes-library/
maybe I should allow contributions,
@admin that would be a great idea. Did you notice I created a custom shortcode without the premium license? You just leave the "Insert method" on the "Auto insert" option and then use the "add_shortcode()" function of WordPress in the snippet.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@admin what does the "_lws_" in the function names, variables and file paths represent?
Oh, I get it, it should be "_lwh_" (LearnWithHasan) but you use "_lws_" in a few places in the "Used By All Tools" snippet; was that on purpose?
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
You will want to add the following on the Replace WordPress Logo snippet:
function my_login_logo_url() { return home_url(); } add_filter( 'login_headerurl', 'my_login_logo_url' );
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
And also add
function my_login_title() { return 'Log In | ' . get_bloginfo('name'); } add_filter('login_title', 'my_login_title');
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
I've created a public GitHub Repository for these. https://github.com/SSAdvisor/wpCodeSnippets
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor I just use this to make my functions unique.
Hi guys I am trying to convert the PHP tools website: https://gtseotools.com into a WordPress website. I have for example the full codes for the Plagiarism Checker but I am unsure how to make it work on WordPress. I also want to do the same for all the other tools on the website. I just need help to know how to convert one tool and I''ll convert the others myself.
@google-jameskiarie why? Do you own the stated website? If so, show us the code. Have you taken the SaaS course; Hasan explains it all in the course.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor Yeah I own the website, it's a PHP script I bought from codecanyon...Here is the code for the Plagiarism checker specifically <
@google-jameskiarie Hi friend, I see it is a codecanyon script.
are you familiar with PHP? did you watch my latest course? I showed how to build a tool step by step on wordpress. you can replace the code with whatever tool you want
The code you attached is a combination of HTML, JS, and CSS; this is the front end. if you are a PHP web developer, you can get out the code and convert into WordPress. otherwise it is not a simple process if you are not familiar with the code.
@admin Yeah i know thats the frontend. I just have a basic understanding of PHP. So I will try to do it myself. Thanks
@admin Hi I just have a basic understanding of PHP, Which course are you talking about? the one about turning WordPress into Saas or the one where you created a hook generator? Personally, my only issue is making sure the script works on WordPress, as for the other parts I can do it myself.