Is It Possible To A Link To The Homepage From The Admin Sidebar?

The $location parameter was incorrect. Try this: function redirect_to_local_110(){ wp_redirect( home_url() ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( ‘admin_menu’, ‘add_home_link’, 1001 ); Or you could use this: function redirect_to_local_110(){ wp_redirect( ‘http://www.example.com’, 301 ); exit; } function add_home_link() { add_menu_page( ‘Course’, ‘Course’, ‘read’, ‘home’, ‘redirect_to_local_110’, ‘dashicons-welcome-learn-more’); } add_action( … Read more

remove custom post type ulr

Your issue is related to your use of feed, which is both a reserved keyword, and an existing URL rewrite. e.g. RSS feeds etc: example.com/feed/rss2 You need to change your rewrite rules to use something other than ‘feed’ in your URL. The same goes for any taxonomies or post types that try to call themselves … Read more

Add custom field to post with some part of url as value

I found this solution, it works great. I will share it here if someone else need it. $currenturl=”http://” . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]; $id = $post->ID; if ( preg_match(‘/\?(.+)$/’, $currenturl, $matches) ) { $value = urldecode($matches[1]); add_post_meta($id, ‘my_new_custom_field_name’, $value, true); }

How to create short urls for sharing and downloadable content?

Here’s a possibly simple solution, using an ancillary table, and user-defined short slugs: create a post_meta “short_slug” when creating a post, the link-name from your example on save_post, if (meta_key=’short_slug’ and is_a_valid(meta_value)) wpdb->insert into short_slugs_table slug,permalink , your index.php on your mgscr.com could then open a mysql connection to the same db, parse the url … Read more

Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?

For normal posts you can set the permalink structure on Settings → Permalinks. All details can be found in the Codex For custom post types you can set the slug when you registering it: add_action( ‘init’, ‘create_posttype’ ); function create_posttype() { register_post_type( ‘cpost’, array( ‘labels’ => array( ‘name’ => __( ‘cpost’ ), ‘singular_name’ => __( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)