Khairil Zhafri
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to display the number of search results found (redux)replace:
if( have_posts () ) :
with:
if ( ! $_GET["cat"] == '' ) { $filter_cat = '&cat='.$_GET["cat"]; } $allsearch = &new WP_Query('s='.str_replace(' ', '+', get_search_query()).'&showposts=-1'.$filter_cat); $count = $allsearch->post_count; wp_reset_query(); if( have_posts () ) : $have_post = '1'; $actual_url = currentURL(); $constructed_url = get_bloginfo(url).'/search/'.str_replace(' ', '+', get_search_query()).'/'; $replace = str_replace('page', '', str_replace('/', '', str_replace($constructed_url, '', $actual_url))); $count_max = $replace*10; if ( $count_max < $count ) { $the_max = $count_max; } elseif ( $count_max >= $count ) { $the_max = $count; } $the_min = $replace*10-9; $display_count = 'Results '.$the_min.' - '.$the_max.' of '.$count; $display_count = str_replace('Results -9 - 0 of', 'Results 1 - 10 of', $display_count);
Then place
<?php echo $display_count; ?>
where you wanna show it.Forum: Plugins
In reply to: WordPress 2.5 Share users table1. Upgrade to 2.6.
2. Make sure all WordPress instances on the same database.
3. Say the primary blog have table prefix set to
wp_
and the secondary ones withwp2_
wp3_
etc. Add the following in wp-config.php of the secondary installations:define('CUSTOM_USER_TABLE', 'wp_users'); define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
Very neat with v 2.6!
Forum: Plugins
In reply to: WordPress 2.5 Share users tableI am getting this error:
Fatal error: Cannot access empty property in /home/poppacket/domains/domain2.com/public_html/wp-includes/capabilities.php on line 169
Forum: Installing WordPress
In reply to: Question on Domain TransferWell this is what I do.
Assuming your blog currently hosted on ohthisismysite.com,
1. Point/park ohthisismysite.org to ohthisismysite.com using domain pointer/parking in your hosting control panel.
2. Add the following codes in wp-config.php after the $table_prefix line:
$hostname = $_SERVER['SERVER_NAME']; $hostname = str_replace('www.', '', $hostname); if ($hostname == 'ohthisismysite.org') { define('WP_SITEURL', 'https://ohthisismysite.org'); define('WP_HOME', 'https://ohthisismysite.org'); }
3. Have your lunch.
4. Voila!
The code above is when you have installed WP in the public root and your WordPress address and Blog address (in wp-admin/general-options) is set to
https://ohthisismysite.com
. If you have something likehttps://ohthisismysite.com/blog
then, change the value forWP_SITEURL
and/orWP_HOME
appropriately.This method works perfectly for my site but not for some other people I had introduced it to. So feel free to try and I’d be happy if it work for you.
Forum: Installing WordPress
In reply to: 2 domains, same blogSorry, I forgot the https:// part
$hostname = $_SERVER['SERVER_NAME']; $hostname = str_replace('www.', '', $hostname); if ($hostname == 'blog.iklerik.com') { define('WP_SITEURL', 'https://blog.iklerik.com'); define('WP_HOME', 'https://blog.iklerik.com'); }
Forum: Installing WordPress
In reply to: Advice on Multiple BlogsThis is like asking which ice cream flavor I wanna have today? Chocolate? Vanilla? Both? ??
Subdomains or directories? Most of the times I’d prefer subdomains. But using subdomains, all WP-generated emails (e.g. password reset) will bear [email protected]. To me, that ain’t pretty.
Separate databases or not? There won’t be much difference.
But then again it all depends on why you want to have 4 different blogs in the first place?
Forum: Fixing WordPress
In reply to: How to style text in text widget?add
style="font-size: 10px"
to the<p>
tag. You can change 10px to whatever.It’d be much easier for others to help if you give the relevant part of the HTML.
Forum: Fixing WordPress
In reply to: Change Blog Post Title to other links like my homepage linkWhen writing/editing a post/page look for Post Slug on the right-hand side.
Forum: Plugins
In reply to: Does this suppost Akismet?Akismet only filters spam comments. It won’t filter spam emails from contact form. Your email can do that.
Forum: Fixing WordPress
In reply to: wp-stats how to use it on a hosted packageone login for both on WP.com
Not possible. WP.com and your self-hosted WP are 2 different wordpress altogether.Forum: Plugins
In reply to: Cross-domain single sign onyeah, probably.
Forum: Plugins
In reply to: Cross-domain single sign on??
Forum: Fixing WordPress
In reply to: Permalinks and how listings appear in GoogleAlright, you can replace that with:
<title><?php echo wp_title(''); if (is_home()) { echo ''; } else { echo ' | '; } bloginfo('name'); ?></title>
Forum: Fixing WordPress
In reply to: Feed website with current blog titleWhat do you mean by “to feed”?
Forum: Fixing WordPress
In reply to: Replace RSS Feed with my own (for real)It has been discussed before.