Tom Penney
Forum Replies Created
-
Forum: Plugins
In reply to: [Lively Chat via SMS] Link to open chat possible?Perfect. That is a very nice solution. Thanks!
Forum: Plugins
In reply to: [Plugin: WordPress Navigation List Plugin NAVT] Disappearing GroupsI’ve found that all my groups disappear when I rename any group in the group options panel. any solution for this?
Forum: Fixing WordPress
In reply to: Dynamic StylesheetHaven’t read this whole post but I have also found the custom fields feature useful for this kind of stuff. then you don’t have to use dynamic style sheet and the author can set styles in a custom field then those styles can be included in-line by your template. simple example would be a background color
$bgstyle=""; <?php // get the background color specified in the page meta data if (get_post_meta($post->ID, "color", true)) { $bgcolor= get_post_meta($post->ID, "color", true); $bgstyle=' style="background-color: ' . $bgcolor . ';"'; } ?> <body <?php echo $bgstyle; ?> >
then the author , while creating a page, can add a custom field with key = “color” and value set to a valid css color like “blue” or “#0000ff” and that color will be set as body background
Same could be done with image background names or whatever. Id recommend adding a test to your code to ensure what is entered as a value is valid. the above could mess up the html if the author entered something like “greenish brown”
I’ve also used this for adding text in the masthead and even defining special menus and such.
Forum: Plugins
In reply to: creating dynamic pagesAs a side note, how does one post in the advanced forum?
This is what I ended up doing although I can’t help but think there is a much better way to do this. Please, any comments welcome, abusive or otherwise ??
what this does is gets one post then modifies it to contain my content:
add_action('init', 'show_item'); function show_item() { $showme = $_GET['showme']; if ( !empty($showme) ){ add_filter('the_content', 'replace_content'); add_filter('the_title', 'replace_title'); add_filter('post_limits', 'limit_1_post' ); //addfilter([other filters to remove other stuff you dont want to display]); add_action('template_redirect', 'replace_template'); } } function replace_content($text) { //do somthing to generate content with $_GET['showme'] $mycontent = "My Dynamic Content"; return $mycontent; } function replace_title($text) { return "My Title"; } function limit_1_post($limit) { return 'LIMIT 1'; } function replace_template() { include(TEMPLATEPATH . '/page.php'); exit; }
Forum: Plugins
In reply to: creating dynamic pagesCan anyone point me in the right direction here?
Forum: Fixing WordPress
In reply to: Change Content of a BlogManage > Posts > Edit
Forum: Fixing WordPress
In reply to: who decided to put “browser happy” in WP?I never saw it because I don’t use IE. A client called me asked “Why I am smearing IE?” I say “What do you mean?” That was when I first saw it. Why hide the link from me?
I’m all for promoting Firefox and other standards compliant browsers but at the same time I don’t like siding against my clients either. Promoting better browsers is one thing but putting anti Microsoft propaganda on my site without my knowledge just seems wrong.