Ip2location plugin in my template header?

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

Page Templates not using functions.php

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

The wordpress website is showing ‘w’ while it loads and in the footer

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

How to display specific child page template in wordpress

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

Is it possible to access plugin data from a custom feed template?

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’; }

Prevent 404 and serve custom template for custom URL

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

dynamic_sidebar() stopped working

In a case like this, you’re probably going to need to check the conditions in dynamic_sidebar to find out what is not happening. if (isset($_GET[‘debugsidebar’])) {add_action(‘init’, ‘debug_sidebar’);} function debug_sidebar() { $id = $_GET[‘debugsidebar’]; $sidebarswidgets = get_option(‘sidebars_widgets’); if (is_active_sidebar($id)) {$status = ” Active”;} else {$status = “Inactive”;} echo “Sidebar ID: “.$id.” (“.$status.”)<br>”; if (array_key_exists($id, $sidebarswidgets)) { … Read more

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