i_know_god
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: next_posts_link – displays same resultsyour code was modded, so i cant really help you but if your loop is messed up previously make sure you look up in your code and reset any queries you have
IE use a wp_reset_query(); function after you end any loop that starts with query_posts()
query_posts() modifies the main loop and thus if you dont reset it you will ge weird pagination or broken pagination.
the alternative to doing this
query_posts($args); would be this $var = new WP_Query($args)Forum: Fixing WordPress
In reply to: next_posts_link – displays same resultsnevermind, its too late in the day, I missed the
&paged= before adding on the pageination informtion
thank you vtxyzzy for your help here, I read every single one of your other posts on the subject =DForum: Fixing WordPress
In reply to: next_posts_link – displays same resultshey guys, i am having the EXACT same problem as this guy, but adding the pageantion to the query didn’t seem to work. I hoped it did =) heres my query.
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php query_posts('post_type=our_work&posts_per_page=12&orderby=rand' . $paged); // call random blog post ?> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> <div class="grid_5a ourWorkImgWidth"> <a href="<?php the_permalink(); ?>"><?php echo the_post_thumbnail(array(200,200,false)); ?></a> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> </div> <?php endwhile; ?> <div id="navLinks" align="center"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }else { ?> <?php next_posts_link('Next Page'); ?> <?php previous_posts_link('Back a Page'); } ?> </div> <?php endif; wp_reset_query();?>
the site is currently under testing @ https://magicvideo.com/cms/work/
Forum: Fixing WordPress
In reply to: Exclude duplicated custom taxonomy within custom post type.reworked the code, and it looks nicer but has the same effect, 1 it doesnt remove the douplicates, and 2 i cant get it to display anything but “array” now
i think its a scope issue
<form method="post" id="clientform" action="" onsubmit="return getURL(this.url.value)"> <select name="url" id="client"> <option selected="selected">By Client</option> <?php $args=array( 'post_type' => 'our_work', 'post_status' => 'publish', 'order' => 'ASC', 'posts_per_page' => -1 ); $my_query = null; $my_query = new WP_Query($args); $k=0; if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); $termArray = array (trim(get_the_term_list( $post->ID, 'client_name'))); // $text = trim(get_the_term_list( $post->ID, 'client_name')); for ($i = 0; $i <= $termArray.count; $i++ ) { for ($j = 0; $j <= $tempArray.count; $j++) { if ($tempArray[$i] == $tempArray[$j]) { unset($tempArray[$k]); $termArray = array_values($termArray); } } // end of for $k++; ?> <option value="<?php bloginfo('url'); echo "/client_name/"; echo $termArray[$k]; ?>"><?php echo $termArray[$k]; ?></option> <?php } ?> <?php endwhile; } wp_reset_query(); ?> </select> <input type="submit" id="clientsubmit" value="Search" /> </form>
Forum: Fixing WordPress
In reply to: Exclude duplicated custom taxonomy within custom post type.made some code adjustments and fixes, but unless i put the array inside the loop i get nothing but the first value, any way to get the array out of the loop?
<?php /** Template Name: Our Work Page */ ?> <?php get_header(); ?> <div id="pagePost"> <form method="post" id="clientform" action="" onsubmit="return getURL(this.url.value)"> <select name="url" id="client"> <option selected="selected">By Client</option> <?php $args=array( 'post_type' => 'our_work', 'post_status' => 'publish', 'order' => 'ASC', 'posts_per_page' => -1 ); $my_query = null; $my_query = new WP_Query($args); $counter = 0; if( $my_query->have_posts() ) { ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php $termArray[] = array (trim(get_the_term_list( $post->ID, 'client_name'))) ?> <?php // $text = trim(get_the_term_list( $post->ID, 'client_name')); ?> <?php for ($i = 0; $i <= $termArray.count; $i++ ) { $tempArrayValueA = $termArray[$i]; for ($j = 0; $j <= $tempArray.count; $j++) { $tempArrayValueB = $termArray[$j]; $counter++; if ($tempArrayValueA == $tempArrayValueB) { if ($counter >= 2) { echo $counter; unset($termArray[$j]); $termArray = array_values($termArray); }else { ?> <option value="<?php bloginfo('url'); echo "/client_name/"; echo $termArray[$j]; ?>"><?php echo $termArray[$j]; ?></option> <?php } }else { ?> <option value="<?php bloginfo('url'); echo "/client_name/"; echo $termArray[$j]; ?>"><?php echo $termArray[$j]; ?></option> <?php } // end of if } // end of for $counter = 0; // reset counter to 0 for each position in the orgiional array } ?> <?php endwhile; } wp_reset_query(); ?> </select> <input type="submit" id="clientsubmit" value="Search" /> </form> <?php query_posts('post_type=our_work&posts_per_page=12&orderby=rand'); // call random blog post ?> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> <div class="grid_5a ourWorkImgWidth"> <a href="<?php the_permalink(); ?>"><?php echo the_post_thumbnail(array(200,200,false)); ?></a> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> </div> <?php endwhile; endif; wp_reset_query();?> </div> <!-- end of pagePost ID --> <?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Exclude duplicated custom taxonomy within custom post type.you can see the current code at https://magicvideo.com/cms/work/
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Adding a Search BarI was able to figure this out, the problem was that my tables didn’t support FULLTEXT indexes, had to go in and try the SQL directly
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Adding a Search Barthis is completely awesome if i can get it working, ive been looking at this code for a very long time and im not having any luck getting it working. my ngg picture search comes back 100% of the time with “no results”
im using the code linked at the top with Version 1.4.3 and wp 2.8.6
ill post the custom code added
search.php<?php // Start of NextGen Gallery search if(is_search()) { $search = $wp_query->get('s'); $keywords = preg_replace('/\+/',' ',$search); if (function_exists ('ngg_get_search_pictures')) { // function from functions.php $nggpictures = ngg_get_search_pictures($keywords, ''); // put the number of pictures by row you want, if you don't want "4" echo "<h2 class='pagetitle'>Pictures</h2>"; if ($nggpictures) { echo $nggpictures; echo '<div class="clear"> </div>'; } else { echo '<p>No pictures were found.</p>'; } } } // End of NextGen Gallery search ?>
FUNCTIONS.php
## Function to do search on gallery pics from NextGen Gallery plugin ## ## 2 vars : (1) $keywords (usually coming from the standard search query from wordpress) ## (2) $numberPicCol (number of pic by row, if null it takes 4 ) function ngg_get_search_pictures ($keywords, $numberPicRow = NULL) { global $wpdb; // $count=1; // if (!$numberPicRow) { $numberPicRow = "4"; } $nngquery = " SELECT pid,description,alttext FROM wp_ngg_pictures WHERE MATCH (description, filename, alttext) AGAINST ('$keywords' IN BOOLEAN MODE) AND exclude = '0' ## start of tags code UNION SELECT pid,wp_ngg_pictures.description,alttext FROM wp_ngg_pictures, wp_terms, wp_term_taxonomy, wp_term_relationships WHERE wp_terms.term_id = wp_term_taxonomy.term_id and wp_term_taxonomy.taxonomy = 'ngg_tag' and wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id and wp_term_relationships.object_id = wp_ngg_pictures.pid and MATCH (wp_terms.name) AGAINST ('$keywords*' IN BOOLEAN MODE) AND exclude = '0' ## end of tags code "; $pictures = $wpdb->get_results($nngquery, ARRAY_A); if ($pictures) foreach($pictures as $pic) { $out .= '<div class="ngg-gallery-thumbnail">'; $out .= '<a href="'.nggGallery::get_image_url($pic[pid]).'" title="'.stripslashes($pic[description]).'" class="thickbox" rel="singlepic'.$pic[pid].'">'; $out .= '<img src="'.nggGallery::get_thumbnail_url($pic[pid]).'" alt="'.stripslashes($pic[alttext]).'" title="'.stripslashes($pic[alttext]).'" />'; $out .= "</a></div>\n"; // pictures use float left, so don't need the code that outputs a <br /> // if ($count == 0) { // $out .= "<br />"; // } // ++$count; // $count%=$numberPicRow; } return $out; };
please help.
Forum: Fixing WordPress
In reply to: Admin Category Management – filter categories for usersI believe you need the role scoper plugin.
I believe this plugin will allow you to assign specific permission per user. So you can assign each user permissions to only edit their category.
Warning, its a seriously in depth and comprehensive plugin. Everytime I use it I have to play around with it to get it what I want to do. Sorry I can’t give you more information on how to use it. But it should be the answer.
Forum: Fixing WordPress
In reply to: Weird /zz directory in my wp-content folderbump, no one will see this on page 11!
Forum: Fixing WordPress
In reply to: Weird /zz directory in my wp-content folderWell I can tell you on my site that I am not using podpress and I’m running latest version of wordpress (2.7.1). I see no correlation between sites that have this problem and the plugins they have installed. I havent been able to find any connection.
Thanks for the reply, hope you come up with something.
Forum: Fixing WordPress
In reply to: Upload Workd but no picture displaysmmk thanks, yeah the file will actually upload into my uploads directory. so i know the file upload process is actually finishing, but like i said the insert screen is blank
Forum: Fixing WordPress
In reply to: Upload Workd but no picture displayshmm in IE i actually got an error on page that i want to share with you guys as i attempt to figure this out.
line: 110 char: 3 Error: Permission denied Cose: 0 URL: https://www.cssorigin.com/wp-admin/media-upload.php?post_id=129&type=image&tab=type_url