Forum Replies Created

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter scottcarlton

    (@scottcarlton)

    Thanks for the quick reply, that was my first option. Unforchantely I don’t know what each child will be because the client will add children as press articles are posted. So I need an archive category that will apply the custom sidebar to any child that will fall under the parent (press). Not sure if that sounds clear though.

    Thread Starter scottcarlton

    (@scottcarlton)

    No Help to this question. Closed

    Thread Starter scottcarlton

    (@scottcarlton)

    this topic doesn’t seem to have support. Close Post.

    Thread Starter scottcarlton

    (@scottcarlton)

    Big Bagel, I wanted to thank you for all your help and teaching me some great stuff along the way! Thanks again!

    Thread Starter scottcarlton

    (@scottcarlton)

    got the toggle working the way I wanted it to with the code bellow.

    $(document).ready(function() {
    	$('.bio-block').hide();
            $('.show').click(function(event){
                event.preventDefault();
                var sliderContent = $(this).next('.bio-block');
                $('.bio-block').not(sliderContent).hide();
                sliderContent.toggle();
            });
            $('.close').click(function(){
                $(this).parent().hide();
            });
        });

    Thread Starter scottcarlton

    (@scottcarlton)

    forgot about that. Fixed it and now works. Almost there now. Just have to get it to close div if another div is clicked to open and get the footer to move down when open.
    Thanks again for all your help!

    Thread Starter scottcarlton

    (@scottcarlton)

    Fixed the class issue and set “a” to .show instead. Then set jquery .show back to .slideToggle

    Now just need to get the function working through function.php

    Thread Starter scottcarlton

    (@scottcarlton)

    Ya, I removed the script from the header. had the script run in the page just to get it working. Can’t get the function.php to work with

    function add_my_js() {
        wp_register_script( 'my-author-js', get_template_directory_uri() . '/author-toggle.js', array( 'jquery' ), false, true );
        wp_enqueue_script( 'my-author-js' );
    }

    the file is under wp-content/theme/my-theme

    Once I remove the code from the page directly and place the code back in the js file with the add_my_js in function.php it doesn’t work. Would like to put the file in my js folder under wp-content/theme/my-theme/js

    I have been building this theme from scratch. Here is my function.php

    Thread Starter scottcarlton

    (@scottcarlton)

    Alright we are making headway here. I have got the code working with this

    $(document).ready(function(){
    
    $('.hidden').hide();
    
    $('a').click(function(){
    $( this ).next('.hidden').show('fast');
    
    $('a.close').click(function(){
    $('.hidden').hide('fast');
    })
    });
    
    });

    It allow only the one div to be opened. Now just have to get it opening div and if another is open close it.

    Thread Starter scottcarlton

    (@scottcarlton)

    $(document).ready(function(){
    
    $('.hidden').hide();
    
    $('a').click(function(){
    $('.hidden').show('slow');
    
    $('a.close').click(function(){
    $('.hidden').hide('slow');
    })
    });
    
    });
    Thread Starter scottcarlton

    (@scottcarlton)

    Ok I have got it to work with this. But it opens all the hidden divs. Now I need to had a parent/child to it if I am correct.

    <script src=”https://pastebin.com/embed_js.php?i=LH7xvpyf”></script&gt;

    I had to post the code directly into the page though, because it’s not working through function.php

    Thread Starter scottcarlton

    (@scottcarlton)

    Doesn’t seem to be loading the js file.

    Thread Starter scottcarlton

    (@scottcarlton)

    page is up. here

    Still not working. Right now just copy pasted as you say just to see if I could get it working. There will be multiple ones though because it is in the query post loop.

    Thanks for your help. This defiantly help me understand this alot more.

    Thread Starter scottcarlton

    (@scottcarlton)

    Here is a link to what I am trying to accomplish so what.

    So I have my get_title and professional title with image in a box with the “a href” attribute and get_content and contact info in a hidden div until clicked. All in a loop.

    here is a link to the code….

    Wish I had more, but as I work on this will try and get a page up for you to see. Thanks again!

    Thread Starter scottcarlton

    (@scottcarlton)

    @big Bagel
    Thanks for your response. Ya, the code as of now is in the header.php file. Not sure if that is best, but as a newbie and not an experienced js coder or wordpress coder, it’s the easiest for me. This issue is that it does target all hidden divs causing them all to open or close. The other issue that I came across in the loop is that it will target only one div instead of the div in that particular loop posting. I keep search google for a fix, but haven’t found one yet.
    As for the plugin, it looks great, but I am trying to stay away from plugins as much as possible. I would rather learn how to do it versus just adding a plugin for something. Helps me learn. Just a personal thing. Plus my trying to make it user friendly as possible for my client. So shortcode just adds one more think to teach my client.

    @swansonphotos
    Thanks for the posting code rules. I’m new to the forums and didn’t realize the code posting. It will be helpful in the future

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