Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1258514
    admin1213
    Participant

    My Events page has only Events appearing on it, but my Blog page shows my blog listings as well as all my Events. I have designated them as Events and Blogs separately in my Page settings. What am I missing that I need to do? Thanks.

    #1258769
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Thanks.

    #1259362
    admin1213
    Participant
    This reply has been marked as private.
    #1259436
    Rahul
    Moderator

    Hey There,

    Thanks for writing in!

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1259580
    admin1213
    Participant
    This reply has been marked as private.
    #1259754
    Nabeel A
    Moderator

    Hi there,

    Thank you for providing the credentials. I’m seeing errors on your site due to the invalid tags used in your Customizer. Please remove the script tags <script></script> from Appearance > Customize > Custom > Edit Global Javascript. Please note that <script></script> are automatically added when you add code in Customizer’s Javascript field.

    Let us know if the problem remains!

    #1259819
    admin1213
    Participant
    This reply has been marked as private.
    #1260052
    Rue Nel
    Moderator

    Hello There,

    Let’s fix first the javascript issue in your customizer. Please keep in mind that the custom JS will not accept script tag because it is already wrap with the tag. To insert a custom JS, you will need to have a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After the child theme is set up, please add the following code in your child theme’s functions.php file

    // Add custom script
    // =============================================================================
    function add_custom_script(){ ?>
    
      <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
      <script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us14.list-manage.com","uuid":"cc25fbe1cb979807f5006b9a2","lid":"1ad5996a84"}) })</script>
    
    <?php }
    add_action('wp_footer', 'add_custom_script');
    // =============================================================================

    And if you do not want to use a child and will just rely on adding the script in your customizer, please have the JS code updated and use this instead:

      </script><script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
      <script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us14.list-manage.com","uuid":"cc25fbe1cb979807f5006b9a2","lid":"1ad5996a84"}) })

    Please let us know how it goes.

    #1260067
    admin1213
    Participant

    Sorry, that didn’t work. I used the last option, just updating the JS code to what you sent and the issue remains. I have only events on my Events page, which falls into a category archive for some reason. But on my Blog page I have events, blogs and sermons, instead of just blogs. I only want blogs to appear on the blog page, if that is possible. Thanks very much.

    #1260334
    Rue Nel
    Moderator

    Hello Again,

    In my last reply, I wanted to fix the Javascript error in your site. This means that the Blog issue is not handled yet. Please keep in mind that the blog page or blog index will always display all the posts regarding of the category. Now, back to your original post. This is not an issue because as I’ve said, by default, WordPress will display all your post. What you have in mind is this; you only wanted to display display blog post with the category as blog and you want to exclude any other categories particularly events and sermons from the blog index.

    Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After the child theme is set up, please add the following code in your child theme’s functions.php file

    // Exclude posts that has Events and Sermon category from the blog index
    // =============================================================================
    function exclude_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-26,-24' );
        }
    }
    add_action( 'pre_get_posts', 'exclude_category' );
    // =============================================================================

    We would loved to know if this has work for you. Thank you.

    #1261678
    admin1213
    Participant

    Thanks for the info, but I am sad to say that I did not create my site as a child theme. I used the parent version of the X theme, which was my mistake. This is my very first site development project and I didn’t realize I should have used the child theme until I was done. I guess I can just live the the fact that all the events and sermons will just appear with the blogs on the blog post. Thanks for your time! I will certainly keep this information for the next time I create a site and I will be sure to use the child theme!

    #1261906
    Prasant Rai
    Moderator

    You are most welcome. 🙂

  • <script> jQuery(function($){ $("#no-reply-1258514 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>