This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Andre Goersch

Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Author
    Replies
  • in reply to: TGM Plugin Activation #14273
    Andre Goersch
    Participant

    That works perfectly. Thanks.

    Another nice piece of information that would be great to have on the official docs. 🙂

    in reply to: Custom template part file for Grid Shortcode #13846
    Andre Goersch
    Participant

    Bingo, we have a winner. That works perfectly. I wasn’t really clear on what was the purpose of the $type parameter before, but now it makes sense.

    Thanks very much Jason, you’ve been great help as always.

    in reply to: Custom template part file for Grid Shortcode #13844
    Andre Goersch
    Participant

    That gives the same result as using is_page('franqueado'), it changes the main loop to use that template part.

    in reply to: Custom template part file for Grid Shortcode #13842
    Andre Goersch
    Participant

    I found the function is_main_query() that might work here, but from the documentation it looks like I need to compare it to a query object… which I don’t have.

    Am I on the right path here?

    in reply to: Custom template part file for Grid Shortcode #13841
    Andre Goersch
    Participant

    That’s the part that is getting me. I tried something similar before, but if I just create a check like…

    if ( is_page('franqueado') ) {
    	$part = 'franquia-grid';
    }

    … what happens is that the entire loop for the page “franqueado” changes to my custom template, displaying the normal page content as a single element of the grid. I don’t know how to limit the change to the secondary loop the shortcode creates.

    in reply to: Custom template part file for Grid Shortcode #13839
    Andre Goersch
    Participant

    I tried your code, but I’m having the same result, the actual archive pages work fine, but not that shortcode. Doesn’t the fact that I’m using the shortcode on a normal page requires different expressions?

    in reply to: Problem with custom post formats #13436
    Andre Goersch
    Participant

    I see. So I kept the add_theme_support declaration in the beginning, and replaced the entire following function and filter for what you provided, and now it seems to be working correctly.

    Thank you so much for the assistance. As karlo pointed out, it would be great if you could update the docs with this sort of information, since it’s basically where I base all my work from.

    in reply to: Problem with custom post formats #13428
    Andre Goersch
    Participant

    Oh, I wasn’t aware of these changes. My current code is pretty much the same as featured on the documentation. Since I’m more a designer that writes some code than a developer, I usually stick to copy-pasting code as much as possible.

    add_theme_support( 'post-formats', 
      array( 
        'aside'
        ,'gallery'
        ,'link'
        ,'image'
        ,'quote'
        ,'video'
        ,'audio'
      )
    );
    
    // Use content-{post_format}.php for listing posts
    function my_template_parts( $parts ) {
         
      global $post;
    
      // Determine post format where relevant
      $post_format = '';
      if( is_object($post) ) 
        $post_format = get_post_format();
    
      // Adjust template parts
      $parts['index'] = $post_format;
      $parts['list'] = $post_format;
      $parts['list_paginated'] = $post_format;
      $parts['list_slider'] = $post_format;
      $parts['single'] = $post_format;
      $parts['archive'] = $post_format;
      $parts['search_results'] = $post_format;
    
      return $parts;
    }
    add_filter( 'themeblvd_template_parts', 'my_template_parts' );

    I’m reading the links you sent, and I’m not 100% positive on what I need to change. Do I just need to add , $type to the function declaration? Some of the code on those posts don’t really resemble mine so I’m not sure how I need to implement other changes.

    Thanks a lot for the help so far.

    in reply to: Custom post formats on Search Results #9846
    Andre Goersch
    Participant

    Oh, nevermind, I figured it out, I needed to add

    $parts['search_results'] = $post_format;

    to the $post_format array. I was trying ‘search’ before.

    in reply to: Best practice for new page template #9394
    Andre Goersch
    Participant

    Alright, that’s good to know. I’ll just stick with what I’ve been doing with my previous code base for those specific pages. Thanks for the advice on the element functions, those might help as well.

    And thanks for making Jump Start, it really is helping me bring my work to the next level. Cheers!

Viewing 10 replies - 1 through 10 (of 10 total)