Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

login

Problems with is_user_logged_in() | Function in WP

Your last lines are missing semi-colons: echo ‘<div class=”omid-header-proimg”><img src=”‘. bloginfo(‘template_url’) .’/images/omid-nonsignin.png”></div>’; echo ‘<div class=”omid-logpanel”><a href=”https://test.com/panel”>login</a></div>’;

Categories login Tags login

Cant login to wp-admin

Compromised theme, most likely. Check theme files for inserted code, along with inserted code in other files. Change credentials everywhere (Host, database, wp admin, ftp). Look at all files manually, plus files that shouldn’t be there (like extra ICO files as in .somefile.ico , which have php code inside. (Notice the leading dot, which indicates … Read more

Categories wp-admin Tags login, wp-admin

Can I (and should I) change the login-URL from functions.php?

You should change the login url from default than it’ll hard for hackers to find the login page so it’ll be safe for you. Here is the code to change the url. // Add rewrite rule and flush on plugin activation register_activation_hook( __FILE__, ‘NLURL_activate’ ); function NLURL_activate() { NLURL_rewrite(); flush_rewrite_rules(); } // Flush on plugin … Read more

Categories login Tags login

Is it possible to add the_content filter upon login?

You’ve misunderstood how hooks, and PHP, work. Hooks are not persistent. Each time you visit a page in WordPress the PHP scripts that comprise WordPress all get run. Every time. This includes plugins and the theme’s the functions.php file. So when you run add_action() that queues up a callback function to run whenever the corresponding … Read more

Categories hooks Tags actions, hooks, login

Multi-site User Sessions

@brianmcculloh As @John P Bloch said, WordPress Multisite is a perfect fit. The list of sites is what WordPress now calls a Network. Here are some resources that you might find helpful: Creating a Network (WordPress Codex) Installing Multiple Blogs (WordPress Codex) How to enable Multi-Site option in WordPress 3.0 (WPBeginner.com) WordPress 3.0 Walkthrough: Getting … Read more

Categories customization Tags customization, login, multisite, users

Disable all other page except index,register,login till user login

Functional code written using PHP 5.3+ Closures. Read the comments throughout to understand concept and flow. // Hook right before Themes kick in add_action(‘wp’, function(){ // Allow viewing of home/front_page if(is_home() or is_front_page()) return; // Maybe allow access to archives (non singulars) to? // (when you hide important content after <!–more–>) // if(is_archive()) return; // … Read more

Categories login Tags homepage, login, user-registration

Keep Logged in Users out of Admin Panel

You can remove the read capability from subscribers, which is what gives them access to the dashboard. This is best done with an activation hook on a plugin — it only needs to be done once. <?php register_activation_hook( __FILE__, ‘wpse43054_activation’ ); function wpse43054_activation() { $role = get_role( ‘subscriber’ ); if( $role ) $role->remove_cap( ‘read’ ); … Read more

Categories admin Tags admin, login, user-registration, users

Log in / Log Out Custom Button

here is a very simple function that should do it: function loginout_button_wpa89153($echo = true){ if (is_user_logged_in()){ $url = wp_logout_url(get_permalink()); $anchor = “Logout”; }else{ $url = wp_login_url(get_permalink()); $anchor = “Login”; } $button = ‘<a href=”‘.$url.'” class=”join-button”>’.$anchor.'</a>’; if ($echo) echo $button; else return $button; }

Categories PHP Tags code, functions, login, php

WP Multisite login not working on one subsite. Possibly cookies/ history issue?

It seems it is a Cookies issue. Setting define(‘COOKIE_DOMAIN’, ”); and define(‘COOKIE_DOMAIN’, false); seems to work fine, but users had old cookies stored as well – so WordPress was seeing multiple login credentials in the cookies and redirecting to wp-login.php?reauth=1, forcing a new login. I’m trying to re-set the cookies to expire for them, but … Read more

Categories plugin-development Tags login, multisite, plugin-development

Creating custom login errors

From quick look at the login screen code (ouch): add_action(‘login_head’,’ref_access’); function ref_access() { global $error; if( !empty($_GET[‘ref’]) && ‘access’ == $_GET[‘ref’] ) $error=”Restricted area, please login to continue.”; }

Categories login Tags errors, login
Older posts
Newer posts
← Previous Page1 … Page94 Page95 Page96 … Page164 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress