Mohammad Jangda
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to check if a word is in the category slug?You could try something like (add it to your functions.php:
<?php add_filter( 'category_template', 'my_category_template' ); function my_category_template( $template ) { $cat = get_query_var('cat'); $yourcat = get_category($cat); $cat_slug = $yourcat->slug; if( strpos( $cat_slug, 'computers' ) ) $template = locate_template( array( 'computers.php', 'category.php' ) ); elseif( strpos( $cat_slug, 'videos' ) ) $template = locate_template( array( 'videos.php', 'category.php' ) ); // add more else ifs for any other templates return $template; } ?>
This will load computers.php for any slugs with ‘computers’ in it and videos.php for any slugs with ‘videos’ in it. It falls back to the default template (usually category.php) for any other categories.
Forum: Fixing WordPress
In reply to: Use of Global Variables or CachingGlobal variables don’t persist between page loads. Session variables do.
However, for caching, you’ll probably want to use the transients API. It’s a simple way to cache data in the WordPress db.
Forum: Fixing WordPress
In reply to: can I add a comment bar to a new page?Comments work on pages too. Just add the following to your page template and it’ll show the comment form you’ve set up in comments.php:
<?php comments_template(); ?>
Forum: Plugins
In reply to: WpTouch Prevent Plugin LoadingGlad to help ??
Forum: Plugins
In reply to: A gallery plugin for a portfolioCheck out some of the photoblogging themes on the WordPress Theme Directory: https://www.ads-software.com/extend/themes/tags/photoblogging
And for some inspiration (some big names): https://www.ads-software.com/showcase/tag/photography/
Try adding this to your theme’s functions.php file:
if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) { $comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' AND comment_type IN ('comment', '') ORDER BY comment_date_gmt DESC LIMIT 15"); wp_cache_add( 'recent_comments', $comments, 'widget' ); }
Forum: Plugins
In reply to: [Plugin: Zen] Why…Sorry, I accidentally pushed up my incomplete code when I shouldn’t have. Working on it, and should be released soon.
Forum: Plugins
In reply to: WpTouch Prevent Plugin LoadingI’d say there are two possible options
1) Add this to your functions.php
global $wptouch_plugin; if ($wptouch_plugin->applemobile && $wptouch_plugin->desired_view == 'mobile') { remove_action( 'wp_head', array( &$wp_lightboxplus, 'lightboxPlusAddHeader' ) ); remove_action( "init", array( &$wp_lightboxplus, "addScripts" ) ); }
2) Modify the lightbox plugin (downside is that if you upgrade the plugin, you’ll lose the fix). In the lightboxplus.php file, find the following line (it’ll be at the bottom):
if (class_exists('wp_lightboxplus')) { $wp_lightboxplus = new wp_lightboxplus(); }
and replace it with:
global $wptouch_plugin; if ($wptouch_plugin->applemobile && $wptouch_plugin->desired_view == 'mobile') { if (class_exists('wp_lightboxplus')) { $wp_lightboxplus = new wp_lightboxplus(); } }
I haven’t tested it so there’s no guarantee it’ll work. But, hopefully it helps.
Forum: Plugins
In reply to: [Plugin: Edit Flow] Error ssage : “You do not have sufficient permissions”Great! Let me know if you run into any more issues ??
Forum: Plugins
In reply to: [Plugin: Edit Flow] Error ssage : “You do not have sufficient permissions”Thanks for reporting this Sourena. Can you confirm that you have the “Enable Custom Statuses for Posts” checkbox selected under Edit Flow > Settings? It may be turned off, which is likely why you’re seeing the error. If it is enabled, then it likely is a bug.
Forum: Plugins
In reply to: [Plugin: Edit Flow] 505 internal error on 0.3.1Okay, I’ve pushed out v0.3.2. Hopefully that fixes the issue. Let me know if you’re still running into the problem (or any other problem for that matter).
Forum: Plugins
In reply to: [Plugin: Edit Flow] 505 internal error on 0.3.1Ah, sorry guys. There’s a bug where if you have notifications disabled, it breaks the v0.3.1 of the plugin. I’ll release a patch soon.
Until then, you can either:
- go back to v0.2 (download it here: https://downloads.www.ads-software.com/plugin/edit-flow.0.2.zip)
- OR enable notifications through your database: in the *_options table, change edit_flow_notifications_enabled to 1
Forum: Plugins
In reply to: [Plugin: Edit Flow] 505 internal error on 0.3.1That’s odd. Have you tried manually uploading the plugin through FTP and then activating it?
Forum: Plugins
In reply to: [Plugin: Co-Authors Plus] “banner” added to author listwebsherpa: The plugin does have issue with IE7 (which non-compatibility mirrors) and below. I’ll try to fix it when I get a chance.
Forum: Fixing WordPress
In reply to: can’t edit Welcome to our siteAh, sorry; didn’t know that the theme was using widgets for the “about” box. Glad you were able to resolve the issue though ??