Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter Shabir Virk

    (@sakuhetu)

    I Figured out something with this code

    $termarray = array('a-name-female-celebrities', 'b-name-female-celebrities', 'c-name-female-celebrities');
    foreach( $termarray as $terms )
    {
    $getpost = new WP_Query('posts_per_page=-1&femalesubcats='.$terms.'');
    if ($getpost->have_posts()) :
    	while ($getpost->have_posts()) : $getpost->the_post();
    		$posttags = get_the_tags();
    		if ($posttags) {
    			foreach($posttags as $tag) {
    				$all_tags[] = $tag->term_id;
    			}
    		}
    	endwhile;
    endif;
    
    $tags_arr = array_unique($all_tags);
    $tags_str = implode(",", $tags_arr);
    
    $tag = wp_tag_cloud( array('smallest' => 10, 'largest' => 10, 'orderby' => 'name', 'order' => 'ASC', 'number' => 0, 'format' => 'array','include'   => $tags_str ) );
    $tags_per_col = ceil(count($tag)/4); ?>
    <div class="panel panel-primary">
    <div class="panel-heading">
    <h3 class="panel-title bold">
    <?php
    $search = array('-');
    $replace = array(' ');
    $output = str_replace($search, $replace, $terms);
    echo '<span style="text-transform:capitalize">'.$output.'<span>';
    ?>
    </h3>
    </div>
    
    <div class="panel-body">
    
    <div class="tag_column">
    <?php  $count=0;
    foreach ($tag as $tag_item) :
    echo $tag_item.'<br />'; $count++;
    if ($count==$tags_per_col) {
    echo '</div><div class="tag_column">'; $count=0;
    }
    endforeach;
    echo '</div></div></div>'; }
    ?>
    
    </div>

    Now All the Terms are having the output i needed, but the problem is after the first foreach when it starts for next it is including the 1st terms too

    check the screenshot below
    https://tinypic.com/view.php?pic=1zea1qu&s=8

    I think i am missing something, Urgent help is required ??

    Thread Starter Shabir Virk

    (@sakuhetu)

    Thanks Its Working..

    But i don’t need to this actually.

    See this screen shot
    https://tinypic.com/view.php?pic=16huaad&s=8#.U4y6Sih7Qwk

    I need to do this, this is achieved by this code

    $getpost = new WP_Query('posts_per_page=-1&femalesubcats=a-name-female-celebrities');
    if ($getpost->have_posts()) :
    	while ($getpost->have_posts()) : $getpost->the_post();
    		$posttags = get_the_tags();
    		if ($posttags) {
    			foreach($posttags as $tag) {
    				$all_tags[] = $tag->term_id;
    			}
    		}
    	endwhile;
    endif;
    
    $tags_arr = array_unique($all_tags);
    $tags_str = implode(",", $tags_arr);
    $tag = wp_tag_cloud( array('smallest' => 10, 'largest' => 10, 'orderby' => 'name', 'order' => 'ASC', 'number' => 0, 'format' => 'array', 'include'   => $tags_str ) );
    
    ?>
    
    <?php
    foreach ($tag as $tag_item) :
    echo $tag_item.'<br />';
    
    endforeach;

    Now i have to place it over 26 times for a-z terms.

    But i want to do this by foreach as my code is always same

    But when i do this by my code i got this
    https://tinypic.com/view.php?pic=157ypnl&s=8#.U4y6Kih7Qwk

    You can clearly see the terms are mixed up.

    I just wanted the first one by doing foreach

    Thread Starter Shabir Virk

    (@sakuhetu)

    Anyone Please…..

    Thread Starter Shabir Virk

    (@sakuhetu)

    Thanksss ??

    Really you are awesome man saved my hours of searching.

    Thread Starter Shabir Virk

    (@sakuhetu)

    Oh thanks ??

    Everything is perfect.

    Also is there any other option to show a Platinum Feature in top of all?

    Means First Platinum Entries > Featured Entries > Simple Post

    Also there is some more modification i needed (if you can help).

    Right now all the posts are sorted by Date DSC, but i just want only the featured and Platinum listing will be ordered by Random and rest of the simple entries by date only.

    All people are paying me the same amount and the one who paid me few days back go down in the line.

    This is not a good thing, by random order anyone can show anywhere.

    Hope you are understanding my Concept

    Thanks ‘n’ Regards,
    Shabir Virk

    Thread Starter Shabir Virk

    (@sakuhetu)

    Thanks keesiemeijer,

    It is now working but showing a text line before the header

    “CASE WHEN ke_posts.ID = 245 THEN 5 WHEN ke_posts.ID = 239 THEN 4 WHEN ke_posts.ID = 183 THEN 3 WHEN ke_posts.ID = 181 THEN 2 WHEN ke_posts.ID = 196 THEN 1 ELSE 0 END DESC, “

    https://www.ekarnal.com/cats/auto

    Could you please tell me how to fix

    Thread Starter Shabir Virk

    (@sakuhetu)

    Right now i want this in my category.php template

    But it would be better if it will be universal like all of the taxonomy and search results.

    Actually i am having multiple categories for different things

    like auto, property, jobs

    you can see the site here https://www.ekarnal.com/

    It is a city portal.

    Thanks

    Thread Starter Shabir Virk

    (@sakuhetu)

    Hi thanks for the reply man.

    But could you please tell me how to output the results in three columns like the same way i want.

    If i use the “a-d” the the b is below the A and c is below the B

    i want them left to right order.

    Please tell me how to achieve this.

    Thanks

    Thread Starter Shabir Virk

    (@sakuhetu)

    Ooops I was using wrong function to remove the box

    it is “expirationdatediv” not “postexcerpt”

    But the plugin author must provide this feature in built with the plugin.

    Anyway thanks

    Shabir Virk

Viewing 9 replies - 16 through 24 (of 24 total)