Bloke
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Help with creating widget select list of postsI solved it.
$first_query = get_posts('numberposts=-1&cat=10'); if($first_query) { foreach( $first_query as $p ) { if ($p->ID==$person_name) { $is_selected = "selected = 'selected'"; } else { $is_selected = ""; } echo '<option value="' . $p->ID . '" '.$is_selected.'>' .$p->post_title . '</option>'; } } ?> </select>Forum: Fixing WordPress
In reply to: Help with creating widget select list of postsI changed it to this. Can’t get it to show the selected post.
$first_query = get_posts('numberposts=-1&cat=10'); foreach ($first_query as $post) : setup_postdata($post); echo "\n\t<option value='"; if($first_query==the_title()): ?> 'selected="selected" <?php endif; echo "'>"; echo the_title(); echo "</option>"; endforeach; wp_reset_postdata();?> </select>Forum: Fixing WordPress
In reply to: Help with creating widget select list of postsI found a couple tutorials but the select option s were hard coded like this. I need to convert my list of posts.
$options = array('one', 'two', 'three'); foreach ($options as $option) { echo '<option value="' . $option . '" id="' . $option . '"', $select == $option ? ' selected="selected"' : '', '>', $option, '</option>'; } ?> </select>Forum: Fixing WordPress
In reply to: Query loop is only showing half of the list of postsI will close this thread since I solved the original issue and the subject does not apply.
Forum: Fixing WordPress
In reply to: Query loop is only showing half of the list of postsIt is changing the name and if I reload the page it shows. But in the admin the select box refreshes to the first name on the list. I want it to hold the name that is selected.
Forum: Fixing WordPress
In reply to: No publish button. Not familiar with wordpress at all.The owner or administrator needs to change your permissions.
Forum: Fixing WordPress
In reply to: select last insert IDI figured it out. Had to do with entering the values for the item. I added a new column and didn’t account for that. So it was failing to enter the item with a new ID.
Forum: Fixing WordPress
In reply to: select last insert IDI have downloaded and copied all the files. Only on my local host, added a new item won’t record and ID. Is there anything maybe in the database I need to change? There are are only 3 files of the plugin that adds the products and I compared each file.
Forum: Fixing WordPress
In reply to: Adding a PDFHave you successfully uploaded Word or PDF files before?
Forum: Fixing WordPress
In reply to: Redirect to success page after submit formI solved it. I had a space at the top of the page.
Forum: Fixing WordPress
In reply to: Query loop is only showing half of the list of postsThat worked and now it lists all the posts for the category. Now I am trying to get my form to save the value of the person’s name selected in the dropdown:
class PersonofMonthWidget extends WP_Widget { function PersonofMonthWidget () { $widget_ops = array('classname' => 'PersonofMonthWidget', 'description' => 'Displays Person of Month' ); $this->WP_Widget('PersonofMonthWidget', 'Person Month', $widget_ops); } function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = $instance['title']; $person_name = $instance['person_name']; ?> <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Person of Month'); ?>:</label> <select name="<?php echo $this->get_field_name('person_name'); ?>" id="<?php echo $this->get_field_id('person_name'); ?>" class="widefat"> <?php $first_query = new WP_Query('cat=10&posts_per_page=-1'); // The Loop while ( $first_query->have_posts() ) : $first_query->the_post(); ?> <option value="<?php the_title() ?>"><?php the_title() ?></option> <?php endwhile; ?> </select> </p> <!-- --> <?php } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = $new_instance['title']; $instance['person_name'] = $new_instance['person_name']; return $instance; }Forum: Fixing WordPress
In reply to: Query loop is only showing half of the list of postsI turned off all my plugins and its still doing it. Is there something in the database that might save a setting I could check? Like a screen options setting?
Forum: Fixing WordPress
In reply to: Widget to drop down list of peopleI am closing this because the title of the post is not descriptive of what I am try to do.
Forum: Fixing WordPress
In reply to: Widget to drop down list of peopleIt is displaying exactly half of the posts when I change the category. Something is telling it to display just half the results.
Forum: Plugins
In reply to: [underConstruction] Different users site looks differentSeems I was missing a file. Uploaded new WPEC and Gold Cart and refreshed the cache.