Forum Replies Created

Viewing 15 replies - 31 through 45 (of 165 total)
  • Thread Starter Marj Wyatt

    (@marjwyatt)

    Here is a screenshot of active plugins, Jeremy:
    https://screencast.com/t/6IY7Zvya8Me

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Hi Jeremy,

    The issue is one of our favorites, as developers. It is intermittent.

    The problem hasn’t occurred for nearly a week but that doesn’t mean it’s gone for good, in my humble opinion. I made no changes to the site to make it quit happening.

    Anyway, here is the URL: https://sealgrinderpt.com

    When it does fail, enthusiasts who visit the site are trying to post their results to WOD (Workouts of the Day) posts, and it was not the same WOD post in each instance.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Hi Trisha,

    I can’t offer you a live look at the site because that chunk of code is intended to circumvent viewing of the content by non-members.

    I agree. My testing that resulted in the conclusion that the elsif part of my function was causing the problem puzzles me too.

    As I mentioned before, that same code worked with the default theme and all the active plugins. That’s why I turned to researching code I’d written for the custom theme.

    Maybe I should put this in the bug tracker system.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    I try to avoid adding plugins when the code to accomplish the task is just a couple of lines, as in this case. ??

    Thread Starter Marj Wyatt

    (@marjwyatt)

    You can download it from here:
    https://www.ads-software.com/plugins/gravity-forms-post-updates/developers/

    Don’t forget to add the above code to disable updates of that plugin at your site.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    @kais12 – Based on my experimentation, yes. I had a very old version of the plugin working. It was the version that I downloaded from JupiterCow’s Bitbucket repository long before it was published here as a plugin in the WordPress repository. That is still working. It is v0.6.3.0.

    When the updated “broke” the plugin on another development, I backed it out and am still running v1.2.10 there. I disabled updates using the code that I posted above.

    Jake has not come back the last few times that I asked about it at BitBucket. We haven’t heard from him here for 3 months.

    Here’s that thread:
    https://bitbucket.org/jupitercow/gravity-forms-update-post/issue/32/form-is-not-populating-with-data

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Okay. I figured out my own issue and I’m posting it here for others.

    The action that I needed to hook into was woocommerce_sidebar. Here’s the new and working code:

    add_action('woocommerce_sidebar', 'render_wc_thankyou', 40);
    function render_wc_thankyou() {
    	if ( ( is_active_sidebar( 'wc-thankyou-text' ) && is_woocommerce() ) )  {
    		dynamic_sidebar('wc-thankyou-text', array(
    		'before' => '<div class="before-post">',
    		'after' => '</div>',
    	) );
        }
    }

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Would anyone happen to know what hook to use to add a widget to the WooCommerce thankyou.php script?

    This is the code in the child theme’s functions.php

    /** Widgets for WooCommerce thankyou.php **/
    add_action( 'widgets_init', 'wc_thankyou_text' );
    function wc_thankyou_text() {
      register_sidebar( array(
        'name' => 'WC Thank You Text',
        'id' => 'wc-thankyou-text',
        'description' => 'Custom Text for WooCommerce Thank You page',
      ) );
    }
    
    //add_action( 'woo_post_inside_before', 'render_wc_thankyou_text' ); // Didn't work
    add_action( 'woocommerce_thankyou', 'render_wc_thankyou_widget' );  // Doesn't work
    function render_wc_thankyou_widget() {
    	if ( ( is_active_sidebar( 'wc-thankyou-text' ) && is_woocommerce() ) )  {
    		dynamic_sidebar('wc-thankyou-text', array(
    		'before' => '<div class="before-post">',
    		'after' => '</div>',
    	) );
        }
    }

    The sidebar is available and I’ve loaded a text widget and saved it.

    I reviewed this link: https://docs.woothemes.com/document/conditional-tags/

    I don’t see a conditional tag for the thankyou.page.

    I reviewed this link: https://docs.woothemes.com/document/hooks/

    woocommerce_thankyou seems to be the hook but I must confess that the documentation on what this hook actually does is very difficult to find.

    I added this code to thankyou.php (moved to child theme folder)

    <?php echo '<p>This is the custom thank you script</p>';
             get_sidebar('wc-thankyou-text'); ?>

    The paragraph I added is showing but not the sidebar.

    Has anyone tried to do this? Is it possible?

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Thank you terrytsang. I could have sworn I had it that way before and it didn’t work.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Okay. I figured out what the problem was.

    I was looking for an .htaccess method to remove /category/ from the permalink and found this article:
    https://www.wprecipes.com/how-to-remove-category-from-your-wordpress-url

    I added that code to .htaccess and it worked. I had remarked it out during my testing and it still failed so I added it back and didn’t give it another thought.

    My permalink structure is set to /%category%/%postname%/

    Taking that code out of .htaccess got the pagination working for regular blog posts but /category/ was back in the permalink. To overcome that, I changed the category base to something else shorter and more meaningful.

    Now pagination works.

    I’ll leave this thread open for a while to see if someone can explain why the following line of code in .htaccess would cause a failure on pagination.

    Here’s the code:
    RewriteRule ^category/(.+)$ https://demo.literalgal.com/$1 [R=301,L]

    Thread Starter Marj Wyatt

    (@marjwyatt)

    I’m seeing that I did not actually answer the question you asked, Keesiemeijer.

    The above code snippet is a function on the template. I left out the rest of the template code intentionally because it didn’t seem relevant to my question.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Just to recap. You created a new page template and call this function inside this theme template? And the ‘shows’ post type posts don’t display.

    Yes. I have a template named home.php. I created a WordPress page named home and used home.php as the template.

    Removing the rewind_posts(); statement did not change the behavior but I left it out anyway.

    I just tried these tests to no avail:
    1) renaming that template to front-page.php
    2) renaming that template to index.php
    3) assigning that template as static front page under Settings->Reading
    4) assigning that template as static posts page under Settings->Reading

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Hi Keesiemeijer.

    I set the posts_per_page under Settings->Reading->Blog pages show at most.

    The query for post category archives is not a custom query. It is a link from navigation that points to the category archive.

    If I click author or tags from the results of that same link, pagination works.

    This is what puzzles me.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    I guess no one had any ideas. I’ll mark this resolved.

    Thread Starter Marj Wyatt

    (@marjwyatt)

    Okay, I got the problem solved but the solution creates a new question. Here is what made it work.

    This code was added to front-page.php:

    add_action( 'pre_get_posts', 'vm_get_shows' );
    function vm_get_shows ( $query ) {
        $query->set('post_type', array( 'post', 'page', 'nav_menu_item', 'shows' ) );
    }

    And this is the new query:

    echo '<aside class="home-bottom-right widget-area two-thirds last">';
       wp_reset_query();
       $args = array( 'post_type' => 'shows' );
       $vmQuery1 = new WP_Query( $args );
       if ( $vmQuery1->have_posts() ) : while ( $vmQuery1->have_posts() ) : $vmQuery1->the_post();
          $postID = get_the_ID();
          $postDate = get_the_date('', $postID);
          $postType = get_post_type( $postID );
          $postTitle = get_the_title($postID);
          if ( $postType == 'shows' ) {
            echo '<p>The $postID is ' . $postID . ' The $postDate is ' . $postDate . ' The $postType is ' . $postType . '</p>';
            the_title();
            echo '<div class="entry-content">';
              the_content();
            echo '</div>';
          }
          endwhile;
          endif;
          wp_reset_postdata();
    echo '</aside>';

    The part of the query that provokes a new question is this:

    Why, if the query was set up with one arg, specifically post_type=>’shows’, did I have to redundantly ensure that I was dealing with a ‘shows’ post to make it work?

Viewing 15 replies - 31 through 45 (of 165 total)