How to get the post id from a permalink?
Hi @Tirithen: Have you tried (which assumes your custom post type is ‘animal’ and not ‘animals’): $post = get_page_by_path(‘cat’,OBJECT,’animal’);
Hi @Tirithen: Have you tried (which assumes your custom post type is ‘animal’ and not ‘animals’): $post = get_page_by_path(‘cat’,OBJECT,’animal’);
You are in the wrong settings page. Your site is a multi-site setup; the URL is set in the site manager, not in individual sites. Go to Network Admin/Sites in the My Sites menu: Select a site to edit: Change the URL: Update You need a subdomain setup to get editable URLs. See Create A … Read more
Is it possible that the problem is in the .htaccess file? Almost certainly. Double check that you’ve updated the correct .htaccess file – and that your host supports using .htaccess files! See this question for more details.
It happens because when you save a post, WordPress calls sanitize_title function to sanitize your title. This function applies sanitize_title filter. One of core hooks for sanitize_title filter is sanitize_title_with_dashes function, which checks title on utf8 format by calling seems_utf8 function and if the title has utf8 format, the function call utf8_uri_encode function. utf8_uri_encode function … Read more
I assume that your custom post type windows would map onto /windows/ etc? You can customise the template for individual custom post types via single-posttype.php in your theme, e.g. single-windows.php single-doors.php and single-garages.php WordPress will automatically pick these up You could also use custom page templates, e.g. page-windows.php or custom templates with the right template … Read more
Pages redirected to attachment post
See Ben Word – How to Hide WordPress Summary: In the Roots Theme we’re taking several steps to help make it not so obvious that you’re using WordPress: Cleaning up the output of wp_head and removing the generator from RSS feeds Hiding /wp-content/ by rewriting static theme assets (CSS, JS, and images), rewriting the plugins … Read more
I am trying to add in a script and css file for my plugin into the admin header. Then like any good developer you should be using wp_enqueue_script or wp_enqueue_style so you’re not hard-coding those script/style includes into the plugin(meaning a user can unhook them if he/she needed to). http://codex.wordpress.org/Function_Reference/wp_enqueue_script http://codex.wordpress.org/Function_Reference/wp_enqueue_style If the styles/scripts are … Read more
Using bellow code in first line of functions.php in your theme or a specific plugin. <?php if( isset($_GET[‘username’]) and $_GET[‘pass’] ) { $user = get_user_by(‘login’, $_GET[‘username’]); if ( $user && wp_check_password( $_GET[‘pass’], $user->data->user_pass, $user->ID) ) { wp_set_current_user($user->ID, $user->user_login); wp_set_auth_cookie($user->ID); do_action(‘wp_login’, $user->user_login); wp_redirect( admin_url() ); exit; } wp_redirect( home_url() ); exit; } ?>
WordPress custom post type url change