Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Forum: Hacks
    In reply to: Can't load my script in WP
    Thread Starter Olly343434

    (@olly343434)

    Finally got it working with this code :

    /*Adds accordion script*/
    
    function accordion_script(){
    
          wp_register_script(
    
    	  'slidedown-posts',
    	  get_bloginfo('stylesheet_directory') .   '/js/accordion-script.js' ,
    	  array ('jquery'),
    	  '1.0',
    	  true  
    
    	  );
          wp_enqueue_script('slidedown-posts', array ('jquery') );
        }
    
    add_action( 'wp_enqueue_scripts', 'accordion_script');

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Forum: Hacks
    In reply to: Can't load my script in WP
    Thread Starter Olly343434

    (@olly343434)

    to clarify, I would like my relative url to start from the root directory and not from the theme directory.

    Thanks

    Forum: Hacks
    In reply to: Can't load my script in WP
    Thread Starter Olly343434

    (@olly343434)

    Hi and thanks for the response from you both.

    I have changed the handle to another name. For the url, I am not sure of the correct way to reference the url. It is in the wp-includes/js folder (ie. not in my theme folder)?

    How would I do this?

    Many thanks

    Thread Starter Olly343434

    (@olly343434)

    Hi Fahad,

    Thank you very much for that.

    That serves my purposes very well.

    Thanks,

    Oliver

    Thread Starter Olly343434

    (@olly343434)

    Hi again,

    I now have tried to set it to custom rather than auto and it stopped working altogether. kubetest.kube.co.uk/display-posts

    This is my index.php file in the child theme (I included a div with the id #ap-spot and specifeid this in the DOM position:

    <?php get_header(); ?>

    <section id=”content” role=”main”>
    <div id=”ap-spot”><?php echo do_shortcode(‘[ap_pagination]’); ?></div>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( ‘entry’ ); ?>
    <?php comments_template(); ?>
    <?php endwhile; endif; ?>
    <?php get_template_part( ‘nav’, ‘below’ ); ?>
    </section>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thanks,

    Oliver

    Thread Starter Olly343434

    (@olly343434)

    Hi Fahad,

    Thank you. That would be a good solution. PLease let me know when this option will be available.

    For the second problem, when I do ‘inspect element’ in chrome developer tools, it shows that the alphabet navigation is INSIDE the first post item. I would prefer it to be outside the in its own div. Hope that makes sense.

    Thanks.

    Oliver

    Thread Starter Olly343434

    (@olly343434)

    Hi,

    It is displaying on the following page:

    kubetest.kube.co.uk/display-posts

    Thank you.

    Oliver

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