Posts

wp login page

//Login title function new_wp_login_title() { return "Tech Liberty"; } add_filter('login_headertitle', 'new_wp_login_title'); //login url function new_wp_login_url() { return "http://techliberty.com.bd"; } add_filter('login_headerurl', 'new_wp_login_url'); //login form style function new_custom_login_page_style() { echo ' '; } add_action('login_head', 'new_custom_login_page_style'); //footer function wpse_edit_footer() { add_filter( 'admin_footer_text', 'msit_edit_text', 11 ); } function msit_edit_text($content) { return " Design and Development by MY SOFT IT "; } add_action( 'admin_init', 'wpse_edit_footer' ); //logo add_action('admin_head', 'my_custom_logo'); function my_custom_logo() { echo ' '; } //user logo function no_wp_logo_admin_bar_remove() { ?> $user_id, 'admin_color...

How to Start a Newspaper & News Portal Website from Scratch In WordPress?

Image

Register Custom Post Type

To Register Custom Post // Register Post Type Agent function wppathfinder_custom_post_type() { register_post_type('agent', array( 'labels' => array( 'name' => __('Agents', 'pathfinder'), 'singular_name' => __('Agent', 'pathfinder'), ), 'public' => true, 'has_archive' => true, 'supports' => array('title','custom-fields','thumbnail','page-attributes',), ) ); } add_action('init', 'wppathfinder_custom_post_type');

ACF Custom Post Filtering Code

Use the Code to enable filitering option on custom post type: function my_pre_get_posts( $query ) { // do not modify queries in the admin if( is_admin() ) { return $query; } // only modify queries for 'event' post type if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'event' ) { // allow the url to alter the query if( isset($_GET['event_area']) ) {     $query->set('meta_key', 'event_area'); $query->set('meta_value', $_GET['event_area']);     } } // return return $query; }

Remove Add New Post Sub Menu From Custom Post

// Remove New Post function disable_new_posts() {       $global_settings = get_posts( 'post_type=domain_hosting' );     if ( count($global_settings) != 0 ) {       // Remove sidebar link       global $submenu;       unset($submenu['edit.php?post_type=domain_hosting'][10]);       // Hide Add new button with CSS       // * change post id to id of existing post on next line *       if ((isset($_GET['post_type']) && $_GET['post_type'] == 'domain_hosting') || $_GET['post'] == 273) {           echo '%MINIFYHTMLb8a8432e92a03a7d02f4061d76fed79384%';       }     } } add_action('admin_menu', 'disable_new_posts'); // Remove New Post // add_action( 'admin_init', 'my_remove_menu_pages' ); function my_remove_menu_pages() { global $user_ID; if ( current_user_can( 'client' ) ) { remove_menu_page( 'edit.ph...

How To Remove and Add Visit Site Menu From WordPress Admin Bar?

Using This Code, you can remove the 'Visit Site' Section admin bar drop down and add it to admin bar menu section // Add Visit Site in ID Section   -- Bonus add_action( 'admin_bar_menu', function ( $wp_admin_bar ) {     if ( ! is_admin() ) {         return;     }     /** @var WP_Admin_Bar $wp_admin_bar */     $wp_admin_bar->remove_node( 'view-site' );     $wp_admin_bar->add_menu( array(         'id'    => 'view-site',         'title' => __( 'Visit Site' ),         'href'  => home_url( '/' ),     ) ); }, 31 ); // After `wp_admin_bar_site_menu()` at 30. // Another Way add_action( 'admin_bar_menu', 'make_parent_node', 999 ); function make_parent_node( $wp_admin_bar ) {     if ( ! is_admin() ) { return; }  // end function if not in admin back-end, credit @Rarst   ...

How To Remove Links and Menus From WordPress Admin Bar?

// Remove Admin Menu Visit Link function remove_admin_bar_links() {     global $wp_admin_bar;     $wp_admin_bar->remove_menu('view-site');        // Remove the view site link     $wp_admin_bar->remove_menu('site-name');        // Remove the site name menu     $wp_admin_bar->remove_menu('customize');        // Remove the site name menu     $wp_admin_bar->remove_menu('comments');        // Remove the site name menu     $wp_admin_bar->remove_menu('edit');        // Remove the site name menu     $wp_admin_bar->remove_menu('new-content');        // Remove the site name menu     $wp_admin_bar->remove_menu('appearance');        // Remove the site name menu     $wp_admin_bar->remove_menu('my-account');        // ...