cqwebdesign
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Sidebar depending on PageNevermind,
I found the perfect solution on Stack Overflow.
But for anyone else who may want the same outcome,
replace
<?php get_sidebar(); ?>with
<?php $id = get_the_ID(); $ancestors = get_ancestors($id, 'page'); $top_page = $ancestors ? get_page(end($ancestors)) : get_page($id); if(locate_template('sidebar-'.$top_page->post_name.'.php')) get_sidebar($top_page->post_name); else get_sidebar(); ?>Basically, this will check to see if there are any specific sidebars based on a parent page’s slug.
all you then need to do is copy the sidebar code into a new php file and calling sidebar-{nameofyourpage}.php
{nameofyourpage} being the parent page slug.Forum: Fixing WordPress
In reply to: Clicking Update Page causes webpage to hang and time outHey Jockoe,
I use bluehost.
I found out that it wasnt my host or PHP memory at all, although that might not be the case for you, Per Se..
First off, try disabling any and all your plugins, then activate them one by one and see if one is setting off this problem.
What changes have you made to config.php recently or any other .php file ?
What is the exact error that is being displayed?
I might not be able to help you or tell you exactly what is wrong, but I have written a few things I did to solve my problem. In the end, I just did a clean install and made my code a lot neater, so im not exactly sure what the problem was.
Edit: If my memory serves…. I think I was calling to much css or JS from my <head></head>