WordPress Custom File Permalink
You should make a template out of your file and then in WP create a page named “Example” to which you assign this template.
You should make a template out of your file and then in WP create a page named “Example” to which you assign this template.
Here’s a very basic plugin that does just that: .html on Pages
I found a problem. I needed change function parameter name to “$aVars”. function nw_lang_addQuery($avars)
First off, you should use get_posts instead of a raw SQL query. Or at least use $wpdb. <?php $posts = get_posts( array( ‘post_status’ => ‘publish’ ‘numberposts’ => -1 ) ); Then, try passing the entire post object to get_permalink, which saves some database queries. <?php foreach( $posts as $p ) { $link = get_permalink( $p … Read more
Add to the taxonomy registration: ‘rewrite’ => array( ‘hierarchical’ => true )
You need a vhost for the subdomain that redirects to public_html/sub_domain_folder instead of trying to redirect with .htaccess. You can then do a www redirect in public_html/sub_domain_folder/.htaccess. There should be some option in cpanel when creating the subdomain do specify which folder it directs to if you don’t have direct access to your vhost.
After clicking [publish] once or twice, the permalink fixes itself automagically; I didn’t see it before because I didn’t want to save with the “wrong” permalink.
I can answer your question! I just had the same exact issue myself and figured it out today, so I know exactly what you need to do. I give very detailed instructions and code on my own question posting, so go look there and see if it solves the issue for you. Let me know … Read more
Use parse_url(): echo parse_url( get_permalink(), PHP_URL_HOST );
ok – got this working with a walker in the end; (added a custom directors link to the menu) class Director_nav_links extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names = $value=””; $classes = empty( $item->classes ) ? array() : … Read more