Forum Replies Created

Viewing 15 replies - 16 through 30 (of 42 total)
  • I’m not really sure what your question was here. From what it looks like, you enqueueing your scripts and style sheet. You just need to put the files you have listed in the proper directory within your theme so that the parameters of your enqueue actions are valid. So in other words, just put the js files in a folder called ‘js’ in your child theme. Put the css file in a folder called ‘css’ in your childtheme. Once you have done this, wordpress should automatically link the files to your document footer (since you are using the boolean ‘true’ in your enqueue actions; last parameter.)

    The way I would do it is to register your scripts first, then instead of having all of those separate enqueues, you put the dependencies in the array as your third parameter in the enqueue. see here: http://codex.wordpress.org/Function_Reference/wp_register_script

    Thread Starter thoughtwell

    (@thoughtwell)

    Thanks for the feedback, birgire. I am going to switch the function out of the while loop, and then try to debug using this suggestion.

    yes, thanks a TON! I almost had to abandon this plugin. Shame as popular as Genesis is with even my local colleagues, not to mention worldwide, that Studiopress won’t take over the plugins or develop new ones that are more compatible w/ current versions of Genesis and WordPress. Heck, I’d even pay for a premium, well-documented and well-supported plugin.

    Thread Starter thoughtwell

    (@thoughtwell)

    Great. I went ahead and did this… and so far, everything seems to be registering okay, so I’ll keep as is. Thanks for the feedback!

    Thread Starter thoughtwell

    (@thoughtwell)

    Finally figured this out. in the conditional, I was supposed to be using is_singular('project')
    within the if statement, as the single-cpt.php page is not actually a page template.

    Thread Starter thoughtwell

    (@thoughtwell)

    I’ve also tried it with is_page_template and still no luck. Variation:

    // Register and Enqueue Scripts
    function slay_enqueue_scripts() {
    
    	wp_register_script( 'slay-responsive-menu', get_stylesheet_directory_uri() . '/lib/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );
    	wp_enqueue_script('slay-responsive-menu');
    
    	if ( is_page_template( 'single-project.php' ) ) {
    		wp_register_style('project-style', get_stylesheet_directory_uri() . '/lib/css/project.css');
    		wp_enqueue_style('project-style');
    	}
    
    }
    
    // Implement enqueued scripts
    add_action( 'wp_enqueue_scripts', 'slay_enqueue_scripts' );
    Thread Starter thoughtwell

    (@thoughtwell)

    Thanks for taking the time to clear that up. This is very helpful as I move forward with other functions.

    Thread Starter thoughtwell

    (@thoughtwell)

    … forgot to tick the ‘resolved’ box…

    Thread Starter thoughtwell

    (@thoughtwell)

    Thanks, stephencottontail. That did the trick. Can you tell me what the difference is between these usages? it looks like you are assigning the variable w/ a value, but what is the difference between the way it’s done here and the way it’s done at the beginning of a function w/ the ‘=’ sign? I also sometimes see arrays with ‘=>’ and wonder what the difference is with that usage, as well.

    I’m marking as resolved, and I appreciate your help on this. Thanks again.

    This is what I used, but it just returns the posts rather than my custom post types by term. Not sure why I can’t get it to work. It’s patterned after a function that was shared w/ me by Bill Erickson:

    function smt_related_items() {
    
     $term = get_the_terms( get_the_ID());
      $args = array(
        'posts_per_page' => 4,
        'post__not_in' => array( get_the_ID() ),
        'category_name' => $term[0]->slug
      );
      $loop = new WP_Query( $args );
    
      if( $loop->have_posts() ):
        echo '<div class="related-items"><h3>Related Items from Summit</h3>';
        while( $loop->have_posts() ): $loop->the_post();
          $classes = 'one-half relate-box';
          if( 0 == $loop->current_post || 0 == $loop->current_post % 2 )
            $classes .= ' first';
          echo '<div class="' . $classes . '"><a href="' . get_permalink() . '">' . get_the_post_thumbnail( get_the_ID(), 'pdt-thumb' ) . '</a><p>' . get_the_excerpt() .'</p></div>';
        endwhile;
        echo '</div>';
      endif;
      wp_reset_postdata();
    }

    I’ve been trying to figure out how to do this for the past week and like you, I am completely stumped. Basically, I want to do a ‘related items’ loop below my single post loop on my single custom post type page templates that show a thumb and excerpt for each of maybe 3 or 4 items. This is kinda like on an ecommerce site when you are shopping one item and then they have a “Check out these other items” list.

    The ‘related items’ would be from the same term as the one being displayed in the single post loop on the page.

    This shouldn’t be this difficult, but as you mentioned—every. single. tutorial shows you how to display a loop if you know the parameters beforehand to put into the query, such as your term or taxonomy. Figuring out how to pull the term dynamically is another story and NOBODY has any tuts on how to do this, at least to my knowledge after searching for days on end and hacking my own approach and breaking my own page, repeatedly. I’m no PHP whiz, but I’ve been able to figure out most of my php woes until this one.

    I’m subscribing to this thread should someone come to the rescue. Likewise, if I figure this out I will let you know how I did it.

    I’ve tried getting the post ID, then getting the term of that post ID and a variety of other queries and I just can’t make it happen 🙁

    This issue seems to be happening for me, as well. It had been working fine a couple of weeks ago when I went on vacation. When I got back, I updated the plugin and it isn’t working. I didn’t test it before updating the plugin. However, I also notice Chrome has updated some as well.

    Works fine in FireFox and Safari. Completely hanging up in Chrome (primarily in the lightbox; the thumbnail view seems to be fine.)

    Thread Starter thoughtwell

    (@thoughtwell)

    Just in case anyone else needs help w/ this, I figured it out. You have to set your ‘hierarchical’ key to the ‘true’ value. Otherwise, you end up w/ the problem I have. This is located in my array as shown where you register the taxonomy:

    // registration code for Equipment-Family taxonomy
    function smt_register_equipment_family_tax() {
    	$labels = array(
    		'name' => _x( 'Equipment Families', 'taxonomy general name' ),
    		'singular_name' => _x( 'Equipment Family', 'taxonomy singular name' ),
    		'add_new' => _x( 'Add New Equipment Family', 'Equipment Family'),
    		'add_new_item' => __( 'Add New Equipment Family' ),
    		'edit_item' => __( 'Edit Equipment Family' ),
    		'new_item' => __( 'New Equipment Family' ),
    		'view_item' => __( 'View Equipment Family' ),
    		'search_items' => __( 'Search Equipment Families' ),
    		'not_found' => __( 'No Equipment Family found' ),
    		'not_found_in_trash' => __( 'No Equipment Family found in Trash' ),
    	);
    
    	$pages = array( 'smt_equipment' );
    
    	$args = array(
    		'labels' => $labels,
    		'singular_label' => __( 'Equipment Family' ),
    		'public' => true,
    		'show_ui' => true,
    		'hierarchical' => true,  // edit this to get the desired outcome!!!
    		'show_tagcloud' => false,
    		'show_in_nav_menus' => true,
    		'rewrite' => array('slug' => 'equipment-families'),
    	 );
    	register_taxonomy( 'smt_equipment_family' , $pages , $args );
    }
    add_action( 'init' , 'smt_register_equipment_family_tax' );

    I experienced the same results as winslow.strong@gmail.com… just saying. FRUSTRATING because usually wp upgrades are pretty smooth and this is the first real P.I.T.A. I’ve experienced when upgrading WP 🙁

    Thanks for this, Prasanna. Works beautifully so far in 3.5 w/ the Bones Framework I’m using. I needed to call some styles for a webfont service, and this works great. I’ll have to look a little closer sometime to learn what the ! is_admin function does.

Viewing 15 replies - 16 through 30 (of 42 total)