alanft
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Atahualpa Incompatible with Widget Logic?you CAN call reset query in the logic like that, but there’s a specific option at the foot of the widget admin page (see http://wordpress.org/extend/plugins/widget-logic/screenshots/ ) that calls it before the sidebar is called
also, note if you use full php logic like that you need to explicitly ‘return !is_front_page()’, ie put in which value you would like to RETURN. and also you need to put a ; at the end (see http://wordpress.org/extend/plugins/widget-logic/other_notes/ ) to make it valid php
Forum: Plugins
In reply to: Widget Logic on 2.8a WP page chosen as your static front page needs the special condition is_front_page() as you worked out. if you want things to appear on that home/frontpage and another page you use
is_front_page() || is_page(‘contact’)
or if you want it to appear everywhere except that
!(is_front_page() || is_page(‘contact’))
the .htaccess file does that. it redirects everything that isn’t to an existing file/folder to the WP index.php which then reads the URL and parses it to find out what was requested
Forum: Fixing WordPress
In reply to: Alternating Sidebar Widget Stylesyou CAN do this with my widget logic plugin
http://wordpress.org/extend/plugins/widget-logic/
using the widget_content filter capability. and this in your functions.php:
add_filter(‘widget_content’, ‘make_alternating_widget_styles’);
function make_alternating_widget_styles($content=”)
{ global $make_alt_ws;
$make_alt_ws=($make_alt_ws==”style_a”)?”style_b”:”style_a”;
return preg_replace(‘/(class=”widget )/’, “$1 widget_${make_alt_ws} “, $content);
}so if your widgets are usually class=”widget …” this will add in “widget_style_a”/”widget_style_b” into that class definition.
Forum: Themes and Templates
In reply to: Atahualpa Incompatible with Widget Logic?for a static page you do want to use !is_front_page()
i’ll look at the atahualpa code but it’s not that simple. have you tried the wp_reset_query and reading the faq generally?
Forum: Plugins
In reply to: Widget ttftiles advanced text replacingdid you turn on the filter?
Forum: Plugins
In reply to: Widget ttftiles advanced text replacingok, you could do it entirely in the filter by using your own global in the ttftext_widget_title function. flip the global between two values and do some more preg_replacing to insert extra text into the class=”” bit of the LI item to flip between two classes, and to call the_ttftext appropriately.
something along the lines of (totally untested code off the top of my head)
global $sidebar_alt;
$sidebar_alt=($sidebar_alt==”_alt”)?””:”_alt”;
$insert_img=the_ttftext( $heading, false, “sidebar$sidebar_alt” );(and there’s the preg_replace do to put in the class)
Forum: Plugins
In reply to: Widget ttftiles advanced text replacingif you want to do alternating styles like that you have to first work out how you are going to do that in the CSS for the sidebar widgets anyway.
chances are you’ll use the html for the widget to set a class or something, and you could detect that in the input
Forum: Plugins
In reply to: Plugin relocate-upload – Not quite working in 2.7is there a recommended workround for this bug?
Forum: Plugins
In reply to: Arrays do not work correctly on Widget Logicif is_page(30) doesn’t work then there might be a general problem with the code in your theme resetting query info. check that it works in the WP default theme. and if that stops the problem, you can TRY the wp_reset_query option
http://wordpress.org/extend/plugins/widget-logic/faq/
http://wordpress.org/extend/plugins/widget-logic/screenshots/Forum: Plugins
In reply to: Arrays do not work correctly on Widget Logicis_category(X,Y,Z) isn’t a valid use of the is_category tag.
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
is_category(array(X,Y,Z)) is ok and should work. but if it’s not for whatever odd reason you could try resorting to
is_category(X) || is_category(Y) || is_category(Z)
and so on. try to break it down to see where your code is going wrong. start with one category with is_category(X). if that works, try adding an ‘OR this category’ to make it work with 2 and so on.
Forum: Plugins
In reply to: Arrays do not work correctly on Widget Logichttp://wordpress.org/extend/plugins/widget-logic/screenshots/
“The widget_content filter and wp_reset_query options are at the foot of the widget admin page.”TBH the wp_reset_query is for larger problems than using the ‘array’ variations of those conditional tags.
so if you can get is_category(3) || is_category(4) to work ok instead of is_category(array(3,4)), then the problem is not going to be addressed with that option.
of course, that’s a workround too. not a nice one, but it would work. and if so, i have zero idea why the ‘array’ versions are not working for you. sorry
Forum: Fixing WordPress
In reply to: List most read articlesFWIW i cobbled together the functionality to do this on my own site using a “?list=most_viewed” GET parameter to turn it on using this code in my functions.php
if ($_GET['list']=="most_viewed") { add_filter('posts_fields', 'list_viewed_posts_fields'); add_filter('posts_join_paged', 'list_viewed_posts_join_paged'); add_filter('posts_orderby', 'most_viewed_posts_orderby'); } function list_viewed_posts_fields($fields) { return $fields.", 0+meta_value as total_views"; } function list_viewed_posts_join_paged($join) { global $wpdb; return $join." INNER JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key='views') "; } function most_viewed_posts_orderby($orderby) { return "total_views desc"; }which uses a meta_field ‘views’ that stores hits for a post
Forum: Plugins
In reply to: Arrays do not work correctly on Widget Logici just tried an is_author(array( … )) on my install and it worked ok. sorry.
have you tried to see if the problem persists on the WP default theme?
Forum: Plugins
In reply to: Plugin relocate-upload – Not quite working in 2.7I tried adding a file, moving it to a folder (/share from my www root folder) and then deleting the media library item, and it deleted it ok from the folder on the server.
i haven’t got a 2.8.2 to hand, but RU hasn’t changed a lot with minor WP updates.