cpkid2
Forum Replies Created
-
Ok, I got some help and found the solution.
Around line 496, change this:
$nopages = "AND $wpdb->posts.post_type = 'post'";
To this:
$nopages = "AND $wpdb->posts.post_type IN ('post','videos','projects')";
With
videos
andprojects
being the custom post types.Hope this helps someone out there.
I found that on line 496, changing
post
to another post type worked. So how can I add in an array of post types? I’m not much of a coder so I’m not sure how I’d put it in.$nopages = "AND $wpdb->posts.post_type = 'projects'";
I’m incorporating the Popular Posts into a tab powered by jQuery so using a widget wouldn’t be possible (I think). Thank you for taking the time to reply, anyway.
By the way, I’m using the template tag and currently calling the function like this:
<?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("limit=4&range=all&order_by=views&pages=0&thumbnail_width=23&thumbnail_height=23&thumbnail_selection=usergenerated&stats_comments=0&stats_views=1&stats_date=1&stats_date_format='M j, Y'&wpp_start=\"<ul id='popular-posts-content'>\""); ?>
I noticed that if I add
pages=1
to the list of attributes, it shows everything including the posts in my custom post types and pages. However, if I usepages=0
, it only shows the posts in the default post type. Is there a way to only get rid of the actual pages?try
img.wpp-thumbnail:hover
Would LOVE this feature for custom post types!!
Jeremy, I copied your altered code, named it wordpress-popular-posts.php and replaced it with the original wordpress-popular-posts.php in the plugin folder and I got “Sorry, no data found”. Is there something else I need to do?
Nevermind, I installed it again and it works. The error came out only right when I upgraded the plugin.
Forum: Plugins
In reply to: [Sharedaddy] [Plugin: Sharedaddy] Adding this manuallyThis would be an awesome feature. I switched to ShareThis because ShareDaddy doesn’t have a manual insert option.
Nevermind, this was a Yahoo Small Business Hosting issue. Site is back up now.
Sweet!
Forum: Fixing WordPress
In reply to: !have_posts, show temporary dummy imageI changed line 32 from:
<?php if( $c < 4 ) : for ($dummy= $c; $dummy < 5; $dummy++;) : ?>
to:
<?php if( $c < 4 ) : for ($dummy= $c; $dummy < 4; $dummy++) : ?>
I removed the last semicolon and it seems to be working now. Also, I’m wondering why there was a ‘5’ in the original line instead of ‘4’? Is that necessary for the code to work or was it a mistake? It outputted 5 boxes so I changed it to 4 and it’s working now.
Forum: Fixing WordPress
In reply to: !have_posts, show temporary dummy imageI get an unexpected semicolon on line 32.
Parse error: syntax error, unexpected ';', expecting ')' in blog.php on line 32
Forum: Fixing WordPress
In reply to: !have_posts, show temporary dummy imageThank you for your time, esmi. However, for some reason only one post + one dummy image post is showing.
Here is my full code: https://pastebin.com/5kVU6GMC (I changed it to query 4 posts instead of the original 6)
In the output, only one post and one dummy post shows instead of having one post and three dummy posts showing.
Any ideas?
Forum: Themes and Templates
In reply to: Pagination with custom post type listingThanks for the tip on having the page name and post type name different.
I just have one question: If I name the post type something like “my-projects” and name the page “projects”, the link points to mysite.com/my-projects/ instead of mysite.com/projects
Anyway I can fix this?