alanft
Forum Replies Created
-
do you have some misplaced quote marks there or is that how your code looks?
anyway, if you look up what get_post_ancestors does http://codex.wordpress.org/Function_Reference/get_post_ancestors you’ll see it returns an array of IDs. so pain-center or ‘pain-center’, the slug is no use to match with in_array. find the ID of the page and use that integer instead. That should do you.
Forum: Plugins
In reply to: Name of home pagethere are some themes that prevent is_home and is_front_page from evaluating correctly. try quickly switching theme to a default one. if the problem goes away, then you will have to do some digging in the theme code you have
Forum: Fixing WordPress
In reply to: widget logic helpanother suggestion – try supplying the category slug instead of the ID
Forum: Fixing WordPress
In reply to: widget logic helphttp://codex.wordpress.org/Template_Tags/in_category
in the case of calling in_category with 2 parameters, the 2nd one is the post ID, so in_category(6,770) will be always false or always true, regardless of what post/page/etc you are looking at.
if you are absolutely sure that post 770 is in category 6, then that should always be true and that widget will always show. so i can’t explain what you are seeing.
the form is_single() && in_category(array(1,2,3)) should do what you want. if it’s not, see if it IS working when you switch to a default theme – just to check if the theme code is interfering with WP stuff behind the scenes that alters the evaluation of those conditional tag.
Forum: Fixing WordPress
In reply to: Widget Logic Helphave you tried any of the troubleshooting steps in the faq? (link above)
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Hiding a widget without contentIt can help
you could use logic that returns false under the circumstances that the content is empty, of if that logic is too complex you could use the widget_content filter. you’d have to write a function that tested if the full HTML content of the widget was empty, and then return an empty string
there might be a widget that does what you want (and then you could use WL to show it only when is_category() if needed)
Forum: Plugins
In reply to: [Plugin: Widget Logic] Want no widget on blog postsyou want !(is_page(…) || is_page(‘blog’))
that is, no semicolon (that’s making the statement invalid which amounts to the same as returning false, and you want everything ‘OR’d inside brackets with an ! (NOT) on the outside.
i.e. NOT (A or B or C or D or page E)
And according to http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page you should be able to use is_page(array(x,y,z)) where x y and z are mixes of page IDs, slugs etc
Forum: Plugins
In reply to: [Plugin: Widget Logic] Display widget for specific user onlyi haven’t checked it, but at a guess
get_current_user_id()==3
might work
Forum: Plugins
In reply to: Using Widget Logic to display certain widgets on specific pagesHave you had a quick look at http://wordpress.org/extend/plugins/widget-logic/other_notes/ ?
One of the first example is
!is_page(‘about’) — everywhere EXCEPT this specific WP ‘page’
the blog page depends on how you have your blog set up. on the WL faq at http://wordpress.org/extend/plugins/widget-logic/faq/ it says
“Another source of confusion is the difference between the Main Page and the front page.”
linking to http://codex.wordpress.org/Conditional_Tags#The_Main_Page
Forum: Fixing WordPress
In reply to: checking for widgetscheck out widget logic’s widget_content filter functionality – that might be the best way to do what you want
Forum: Plugins
In reply to: [Plugin: Widget Logic] Error when activatedIt’s not free by the looks of it. Sorry. If you want to give me read access to your install I might be able to spot something – but I realise that’s perhaps a step too far to fix this.
Forum: Plugins
In reply to: how to find home page id for different language pageto make a widget appear when the URL has ?lang=esm use the above, to make a widget vanish when that’s the case use
$_GET[‘lang’]!=’es’
Forum: Plugins
In reply to: [Widget Logic] Widget Logic plugin got my blog in error when activatedi posted on your similar thread that does appear to be a clash between WL and your chosen theme. Unfortunately I do not have access to your theme’s code so it will be hard to troubleshoot the issue.
Forum: Plugins
In reply to: [Plugin: Widget Logic] Error when activatedI’ll have to take a closer look, but it looks like an incompatibility between WL and your theme. Or at least the bit of the theme that’s the rokmenu_wgwt widget.
Is that theme free for me to check the code?