harjeet singh
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display Author details for multiple categories on custom pagePlz somebody give tips . .. . . i tried but failed to get it working properly …. here is the code what i had come up till now
<?php
$city_cats = get_option(‘WP_cities’);
$cities = explode(‘,’,get_option(‘WP_cities’));if (! empty( $city_cats ) ) {
foreach ($cities as $city) {
echo get_cat_name(“$city”). ”;$allposts=get_posts(“cat=$city”);
foreach($allposts as $authorpost) {
$catauthors[$authorpost->post_author]+=1;
}
foreach($catauthors as $key) {
$curuser = get_userdata($key);
$author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename);
echo ‘nickname ) . ‘” ‘ . ‘>’ . $curuser->nickname .’‘;}
} }
?>Forum: Fixing WordPress
In reply to: Missed Schedule in wordpress 2.9.2hi all … just visit here and download the 3 files and upload to your wp-includes directory . It worked for me …. i had some problems using
define(‘ALTERNATE_WP_CRON’, true);
as post t o twitter was not working for scheduled posts…
Forum: Fixing WordPress
In reply to: Missed Schedule in wordpress 2.9.2Hi all .. i searched a lot online and got it working by adding the following code in the wp-config.php , but the main question is that y the scheduling stops by itself ????? Hope the moderators may help us in this regard.
define(‘ALTERNATE_WP_CRON’, true);
Forum: Fixing WordPress
In reply to: Child Category to use different template than parent categoryHey plz someone help ! This isn’t working properly. Only works for the first child category…
Forum: Fixing WordPress
In reply to: Child Category to use different template than parent categoryAchieved what was required using this code …
<?php $this_category = get_category($cat); ?>
<?php if ($this_category->category_parent == 0) { ?><?php $this_category->category_parent = $cat; ?>
<?php } else { ?>
<?php $parent_category = get_category($this_category->category_parent); ?><?php
$pid=$parent_category->cat_ID;
if ($pid==’3′)
include(TEMPLATEPATH . ‘/custom_cat.php’);
else?>
But i am not sure if this is the right way to do …. plz provide suggestions
Original topic for the code is …
Forum: Fixing WordPress
In reply to: Where is my Right Column?I can see right sidebar in your posts page too . If thats not what you want. Then paste the link to the page with right sidebar and the one where you want it to appear.
Forum: Fixing WordPress
In reply to: Alignment of an imageand the errors caused in your theme is just because of the javascript in the header and Web Form Generator 2.0. if you remove that your site will pass validation
Forum: Fixing WordPress
In reply to: Alignment of an imagehi neilcg in the header of your theme it seems like the function
<?php wp_head(); ?>
is called twice… just remove that before continuing further rectification..
Forum: Fixing WordPress
In reply to: Custom Post Count ! Plz Help !Its solved MichaelH thanks for the support. Here is the final code.
$args=array(
‘category__not_in’ => explode(‘,’,get_option(‘excluded_cats’)),
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘showposts’ => -1,
‘caller_get_posts’=> 1
);
$poststocount=get_posts($args);
echo ‘all posts count ‘. count($poststocount);Forum: Fixing WordPress
In reply to: Custom Post Count ! Plz Help !Thanks MichaelH , thats works perfectly fine. There’s new problem for the values for the excluded categories . I am pulling the values from database and using it as follows but it does not work.
$custom_post_excluded_categories = explode(‘,’,get_option(‘excluded_cats’));
$args=array(
‘category__not_in’ => array($custom_post_excluded_categories),
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘showposts’ => -1,
‘caller_get_posts’=> 1
);
$poststocount=get_posts($args);
echo ‘all posts count ‘. count($poststocount);the value for excluded_cats = 21,13
Using the explode command there is no subtraction in the post count.But if i use$args=array(
‘category__not_in’ => array($excluded_cats),
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘showposts’ => -1,
‘caller_get_posts’=> 1
);
$poststocount=get_posts($args);
echo ‘all posts count ‘. count($poststocount);In the result there is subtraction but only for the first category posts.
Forum: Fixing WordPress
In reply to: Using ‘query_posts’ parameters in author.phpTry replacing
<?php query_posts(‘showposts=9999&cat=-30,-32’); ?>
with
<?php query_posts($query_string.’&showposts=9999&cat=-30,-32′); ?>
Just added “$query_string.” and “&” before showposts.
Forum: Fixing WordPress
In reply to: query_posts category_name and showposts problemtry adding $query_string. and & in query posts like this
<?php query_posts($query_string.’&category_name=The Category Name&showposts=5′); ?>
Forum: Fixing WordPress
In reply to: Can this be done with wordpress?working with wordpress is simple just go through wordpress codex. This is very helpful. Secondly you can plan the design of your layout first, later you can take help for making your website work with wordpress.
Forum: Fixing WordPress
In reply to: Page title showing up in main contentSaw your site and the problem is in your header. Just find the below code
<div id=”header”>
<div id=”blog-name”><h1><a href="https://www.leehughes.co.uk/">The adventure of a lifetime</a>
</h1></div>
</div>and check what u have mentioned in place of
<a href="https://www.leehughes.co.uk/">The adventure of a lifetime</a>
Here is the code . Others may find it helpful.
<?php $post_count = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!– If the post is in the category we want to exclude, we simply pass to the next post. –>
<?php if (in_category(‘3’)) continue; ?>
<?php $post_count++; // add 1 to post count ?>
<div class=”post”<h2>”><?php the_title(); ?></h2>
<small><?php the_time(‘F jS, Y’); ?></small>
<div class=”entry”>
<?php the_content(); ?>
</div><p class=”postmetadata”>Posted in <?php the_category(‘, ‘); ?></p>
</div> <!– closes the first div box –><?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
<?php if ($post_count == 0) { ?>
<p>Sorry, no posts matched your criteria.</p>
<?php } ?>