Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post-grid does not recognize custom post types #1

Open
skulegirl opened this issue Aug 20, 2014 · 2 comments
Open

post-grid does not recognize custom post types #1

skulegirl opened this issue Aug 20, 2014 · 2 comments

Comments

@skulegirl
Copy link

I wanted to have a post-cycle with testimonials, but when I put that type in I got nothing. Looked at the code and it seems a switch statement to convert the text specified to the custom post types is missing.

I managed to fix it, but thought I'd pass it upstream.

Patch text to fix the problem:

--- post-cycle.php.orig 2014-07-03 01:21:00.000000000 -0700
+++ post-cycle.php 2014-08-19 21:32:02.826318000 -0700
@@ -23,7 +23,26 @@
'custom_class' => ''
), $atts));

  •   $type_post         = $type;
    
  •   switch ( strtolower( str_replace(' ', '-', $type) ) ) {
    
  •       case 'blog':
    
  •           $type_post = 'post';
    
  •           break;
    
  •       case 'portfolio':
    
  •           $type_post = 'portfolio';
    
  •           break;
    
  •       case 'testimonial':
    
  •           $type_post = 'testi';
    
  •           break;
    
  •       case 'services':
    
  •           $type_post = 'services';
    
  •           break;
    
  •       case 'our-team':
    
  •           $type_post = 'team';
    
  •           break;
    
  •       default:
    
  •           $type_post = $type; 
    
  •           break;
    
  •   }
    $slider_pagination = $pagination;
    $slider_navigation = $navigation;
    $random            = gener_random(10);
    

@cheh
Copy link
Member

cheh commented Aug 20, 2014

Hi, skulegirl.

Sorry, but I can't find this code in post-grid.php and post-cycle.php.
Maybe you mean a carousel.php or carousel-owl.php.
Please, give me link to file in the repo.

@skulegirl
Copy link
Author

Sorry, I maybe wasn't clear - that code is a patch I made, so it's not
currently in post-cycle.php but I think it should be. (See the + signs for
the lines I added). It's pretty much the exact same code as in
carousel.php, but it was missing from post-cycle. It clearly does nothing
for most types, but since the testimonial type is represented internally as
"testi", the translation is necessary for that custom post type.

I also didn't look into it, but the carousel shortcode gives a drop-down
box in the admin panel that lets you choose the custom post type from the
valid options, but post-cycle doesn't. Seems inconsistent and gives room
for configuration error.

Anna

On Wednesday, August 20, 2014, cheh [email protected] wrote:

Hi, skulegirl.

Sorry, but I can't find this code in post-grid.php and post-cycle.php.
Maybe you mean a carousel.php or carousel-owl.php.
Please, give me link to file in the repo.


Reply to this email directly or view it on GitHub
#1 (comment)
.

Anna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants