Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter op1001

    (@op1001)

    Hello,

    add_action( ‘wp_enqueue_styles’, ‘demo_styles’ ); will not work no matter what… i’ve tried all the default themes in wordpress, even deleting everything in the function.php –

    also when you view the source code it doesn’t show..

    add_action( ‘wp_enqueue_scripts’, ‘demo_styles’ ); => this works just fine..

    but i figured wp_enqueue_styles was proper coding as well but it wont work? maybe it is a bug?

    Thread Starter op1001

    (@op1001)

    Okay , I am confused, ther are so many methods and I can’t seem to find a right explanation ..

    In functions.php I have the following..

    wp_register_script( 'info-caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel-5.5.0-packed.js', array('jquery'), '5.5.0', true );
      wp_register_script( 'info-carousel-instance', get_template_directory_uri() . '/js/info-carousel-instance.js', array('info-caroufredsel'), '1.0', true );
    
      wp_register_script( 'jquery.flexslider', get_template_directory_uri().'/js/jquery.flexslider-min.js', array('jquery'), '1.7', true );
      wp_register_script( 'home-page-main-flex-slider', get_template_directory_uri().'/js/home-page-main-flex-slider.js', array('jquery.flexslider'), '1.0', true );
    
      wp_enqueue_script( 'info-carousel-instance' );
        wp_enqueue_script('home-page-main-flex-slider');

    So two scripts are getting enqueued and two are not.

    the question is

    How do I call the two scripts that are not getting engueued in my theme?

    I don’t want the scripts always loading on every page if they arent’ being used? you know what i mean?

    I’ve seen so many techniques for javascript It is confusing … there doesn’t seem to be a standard way to do it

    I’ve seen people add it in their headers etc etc.

    Thread Starter op1001

    (@op1001)

    THis is just an example

    I just went to the free templates right now.

    on this site.

    and here i picked this as the example ONLY..

    Theme

    Magazino..

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    		<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'magazino' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    	</header><!-- .entry-header -->
    
    	<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
    	<div class="entry-summary post-content">
    		<?php the_excerpt(); ?>
    	</div><!-- .entry-summary -->
    	<?php else : ?>
    	<div class="entry-content post_content">
    		<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'magazino' ) ); ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'magazino' ), 'after' => '</div>' ) ); ?>
    	</div><!-- .entry-content -->
    	<?php endif; ?>
    
    	<footer class="entry-meta">
    		<?php magazino_posted_on(); ?>
    		<?php if ( comments_open() || ( '0' != get_comments_number() && ! comments_open() ) ) : ?>
    		<span class="sep"> | </span>
    		<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'magazino' ), __( '1 Comment', 'magazino' ), __( '% Comments', 'magazino' ) ); ?></span>
    		<?php endif; ?>
    		<?php edit_post_link( __( 'Edit', 'magazino' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
    	</footer><!-- #entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->

    Could you use this code in your own theme?

    that is what I meant..

    again this is just an example..

    and since i am here.. what is the purpose of adding the theme name in this line
    <?php edit_post_link( __( 'Edit', 'magazino' ),

    ? I’ve seen it in a lot of code where they add extra ‘name template’

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