How to create new template page and template-parts in wordpress theme [closed]
The spelling of template is wrong change /*Tempalte Name: ICO Calendar Form */ to /*Template Name: ICO Calendar Form */ ref: find detailed info here
The spelling of template is wrong change /*Tempalte Name: ICO Calendar Form */ to /*Template Name: ICO Calendar Form */ ref: find detailed info here
I’m assuming you’re using “IP2Location Tag WordPress Plugin”. In main file of IP2Location plugin, the class instance is created and assigned to the variable. $ip2location_tags = new IP2LocationTags(); To use the plugin in theme, just use the global variable $ip2location_tags. Remember to make sure that the class IP2LocationTags exists first and use global keyword. if … Read more
Your enqueued css should work for all page template if there is no condition applied. could you please share it how you enqueued? Another thing you can check. In header.php, can you please check that wp_head(); function has been called properly in the page template’s head tag. if not exists in the header.php between the … Read more
You can create taxonomy template like taxonomy-[Your-texonomy].php in your theme folder.
If you view the source you will see a w right before the DOCTYPE w <!DOCTYPE html> <!–[if IE 7]> <html class=”ie ie7″ lang=”en-US” prefix=”og: http://ogp.me/ns#”> <![endif]–> <!–[if IE 8]> <html class=”ie ie8″ lang=”en-US” prefix=”og: http://ogp.me/ns#”> <![endif]–> <!–[if IE 9]> <html class=”ie ie9″ lang=”en-US” prefix=”og: http://ogp.me/ns#”> <![endif]–> <!–[if (gt IE 9)|!(IE)]><!–> <html lang=”en-US” prefix=”og: http://ogp.me/ns#”> … Read more
@jersh There is a bug in WP 4.9 Just fire this query to the database. then you will get template in selection drop down. $wpdb->options => replace with your option table name. DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ‘_transient_files_%’ LIMIT 1
Try this… Your code is hitting elseif(is_page() && $post->post_parent ) and stopping there. <?php if(has_children()){ // This is a parent page get_template_part(‘content’, ‘parent’); }elseif(is_page() && $post->post_parent ){ // This is a child page of certain parent page if(is_child_of(689)){ // This is a child page of Parent page having id 689 get_template_part(‘content’, ‘park’); }else{ get_template_part(‘content’, ‘child’); … Read more
The solution, for anyone else interested, was to clear cookies and the cache: clean_user_cache($current_user->ID); wp_clear_auth_cookie(); wp_set_current_user($current_user->ID); wp_set_auth_cookie($current_user->ID, true, false); update_user_caches($current_user); if( current_user_can( ‘mepr-active’, ‘memberships:1,2’ ) ) { echo ‘Hi ‘ . $current_user->user_login . ‘! You are a member’; } else { echo ‘Hi ‘ . $current_user->user_login . ‘! You <strong>not</strong> a member’; }
Got it! But this is a dirty thing. As it won’t take care of pagination and underlying queries. If you need a bit more of WordPress’ logic behind that custom route, please check the answer linked in the comments. But if you just need to serve one static page, this probably is a good starting … Read more
I am using the template file name in the section to load corresponding css files. For static-page.php I am loading static-page.css, similarly for single-post.php I would like to load single-post.css. As said, it is working fine on my static pages, but returns zero on single blog post page. This isn’t really the correct way to … Read more