roowilliams
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Custom Author ListingHi David, thanks again for your reply. I am using a plugin called Types which allows you to make custom post types without coding (take it a look it’s very good.) I have image upload fields for two images for each project and it’s very slick and easy to do – There will be over 80 users that will need to do this very quickly before our show start (14th) so it’s best I keep it simple to people that might not be familiar with WordPress!
Forum: Themes and Templates
In reply to: Custom Author ListingHi David, thanks for your reply. That bit actually works ?? the author_info var is set earlier on so is all good. The problem I am having is fetching the custom posts.
Forum: Themes and Templates
In reply to: Custom Author ListingDidn’t mean to mark this as revolved – still appreciate some help with the custom query!
Forum: Themes and Templates
In reply to: Custom Author ListingUPDATE:
After finding this: https://www.mattvarone.com/wordpress/list-users-with-wp_user_query/ I am getting somewhere. Have the first part working correctly, but still problems getting the custom posts.
Forum: Themes and Templates
In reply to: Custom Author ListingWordPress 3.3.2 BTW
Forum: Fixing WordPress
In reply to: website hacked by ghost-dzI think these so called hackers just look for files on web servers that are publicly writeable. I just fixed a site with the same problem – I had left a template file with permissions 755 and they’d written to it. Reuploaded the file from a back up I had and changed them to 644, all sorted now.
Thanks for the reply Rob. But surely, that messes up your navigation?
Forum: Fixing WordPress
In reply to: Custom Menu Editor doesn't show Custom TaxonomiesStupidly I discovered my problem was that the panels weren’t checked to display under ‘screen options’… doh!
Forum: Fixing WordPress
In reply to: Custom Menu Editor doesn't show Custom TaxonomiesI am having this problem too, did you ever figure it out?
Forum: Fixing WordPress
In reply to: custom post type – paged archivesThis isn’t resolved, I am in the same situation and cannot set my post limit to 1 in the admin as I have a blog which I want around 10 posts on, even though i only want 3 on my custom post type.
Was there ever a solution to this?
Forum: Hacks
In reply to: Using Custom Taxonomies as 'Categories'I figured it out after hours of googling:
// Custom loop for displaying all posts from the project custom post type. $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?> <?php $loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 9, 'taxonomy' => 'work', 'term' => $term->name, ) );
Had to change something but `all works now. This code outputs rows of 3 posts and assigns a class of ‘first to every first post in the row, and also gives each row its own class.
Not the most elegant code, but it works.
// Custom loop for displaying all posts from the project custom post type. $loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 9 ) ); $postcount = 1; $row = 1; while ( $loop->have_posts() ) : $loop->the_post(); echo '<div class="project row-' . $row; if ( $postcount == 1 ) { echo ' first'; } echo '">'; if ( $postcount == 3 ) { $row++; $postcount = 0; } $postcount++; ?>
I realised I was missing a semicolon from echo ‘”>’.
Have now tried it and I THINK IT MIGHT WORK (need to add more than 3 dummy posts to check)
Ok I’m trying it differently, but I am also trying to add row numbers too so that I might have more control over certain rows, but I am getting a syntax error with this.
Please bear with me, I am new to PHP and so am just chopping up bits of code and experimenting ??
// Custom loop for displaying all posts from the project custom post type. $loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 9 ) ); $postcount = 1; $row = 1; while ( $loop->have_posts() ) : $loop->the_post(); echo '<div class="project row-' . $row; if ( $postcount == 1 ) { echo ' first'; } echo '">' if ( $postcount == 3 ) { $row++; $postcount = 1; } $postcount++; ?>
OOPS. Please ignore above code, this is the code I wanted to share:
<?php // create the navigation above the content thematic_navigation_above(); // Custom loop for displaying all projects from a category. $loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 9 ) ); $postcount = 1; while ( $loop->have_posts() ) : $loop->the_post(); echo '<div class="project'; if ( !(($postcount) % 3) ) echo ' first'; echo '">'; $postcount++; ?> <?php the_post_thumbnail(); ?> <?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?> <div class="entry-content"> <?php the_excerpt(); ?> </div> </div> <?php endwhile;