Forum Replies Created

Viewing 15 replies - 1 through 15 (of 31 total)
  • Thread Starter tnoguchi

    (@tnoguchi)

    Just to clarify, this is with the latest version of the plugin 2.1.4

    Hi, it seems that we also have this problem even though we updated to the latest version 1.18.3 on our sandbox using wpDiscuz. Production seems to be working correctly and is running an older version 1.17.2

    Thread Starter tnoguchi

    (@tnoguchi)

    @jnicol

    I also saw the article for updraft plus and amended my .htaccess file before, but I just realized that I needed to add the rule to a subdirectory where my WP install is since it’s not in the root folder.

    After I added the ReWriteRule and set the max execution time to 30 seconds, my backups seem to be working now.

    Thanks everyone for your inputs.

    Thread Starter tnoguchi

    (@tnoguchi)

    Hi Daniel,

    I’ve already tried to set the maximum execution time from anywhere between 30 to 1200 seconds but still haven’t been able to get the plugin to work. Do you have any other suggestions?

    Thanks,

    Tak

    Thread Starter tnoguchi

    (@tnoguchi)

    Hi bcworkz, thank you for your thoughtful insights. I think of all WP things, permalinks and pagination have to be the two things that I find maddeningly complex.

    I think that my approach was probably the issue, like you said. Overriding the default query for archives is far too complex.

    As a solution, I ended up creating a custom page template from the above custom query and assigned it to a page that I created.

    Thread Starter tnoguchi

    (@tnoguchi)

    Well after taking a break and consulting the oracle, I was able to find a helpful post on stackoverflow with a solution by Diogenes.

    The solution actually makes a lot of sense; two nested foreach loops, one to retrieve the category terms and the other to retrieve the individual posts under each category:

    <!-- Begin custom tax loop -->
      <?php
      //Retrieve custom taxonomy terms using get_terms and the custom post type.
        $categories = get_terms('tn_cstm_work_taxonomy');
       //Iterate through each term
        foreach ( $categories as $category ) :
        ?>
          <div class="row">
           //Use $category->slug to retrieve the slug
            <section id="<?php echo $category->slug; ?>" class="large-12 columns" data-magellan-destination='<?php echo $category->slug; ?>'>
               <h3><?php echo $category->name; ?></h3>
    
               <ul class="large-block-grid-4 small-block-grid-2">
                <?php
               //Setup the query to retrieve the posts that exist under each term
                $posts = get_posts(array(
                  'post_type' => 'tn_cstm_portfolio',
                  'orderby' => 'menu_order',
                  'order' =>  'ASC',
                  'taxonomy' => $category->taxonomy,
                  'term'  => $category->slug,
                  'nopaging' => true,
                  ));
                // Here's the second, nested foreach loop that cycles through the posts associated with this category
                foreach($posts as $post) :
                  setup_postdata($post); ////set up post data for use in the loop (enables the_title(), etc without specifying a post ID--as referenced in the stackoverflow link above)
                ?>
    
                  <li>
                      <?php
    //retrieves the post thumbnail for each post
                             $thumb = get_post_thumbnail_id();
                              $img_url = wp_get_attachment_url( $thumb,'medium' ); //get full URL to image (use "large" or "medium" if the images too big)
                              $image = aq_resize( $img_url, 300, 270, true ); //resize & crop the image using aqua resizer https://github.com/sy4mil/Aqua-Resizer
                      ?>
        <figure class="work-thumb">
            <a class="th" href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>">
                <?php if($image) : ?>
                    <img src="<?php echo $image ?>" alt="<?php the_title(); ?> thumb"/>
                <?php else : ?>
                    <img class="" src="<?php bloginfo('stylesheet_directory'); ?>/img/small-placeholder.png" alt="placeholder image"> 
    
                <?php endif; ?>
            </a>
            <figcaption><h4><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4></figcaption>
        </figure>
    
    <?php }
                        ?>
                  </li>
    
                <?php endforeach; ?>
    
              </ul>
            </section>
          </div><!-- .row -->     
    
      <?php endforeach; ?>//Easy Peasy

    You’re welcome. The FAQ on the plugin page isn’t very clear, but it seems that in addition to adding the argument to page-attributes in the register_post_type function, it seems necessary to also add 'order' => 'ASC' in the template custom query in addition to the ‘orderby' argument.

    The plugin won’t add in changes to your template markup. Did you add the modified query code in your template?

    'orderby' => 'menu_order',
        'order' => 'ASC',

    It won’t work without it.

    You can refer to the codex page that I linked above. As I mentioned, the ‘elaborate’ example shows you where the argument goes.

    I can’t really answer this question without looking at the theme code. If you’re using a premium paid theme, I suggest that you ask the theme developers directly. They’ll probably have a support forum for this.

    If not, I would use a code editor to search the theme template files for the specific custom post type slug and or the term ‘register_post_type’.

    You’ll need to add them when you register your custom post type using the register_post_type function.

    See the “Elaborate” example in the codex page that I linked above. If you’re using a plugin to create your custom post type, try to see if you can add an argument:

    'supports' => array('title, thumbnail', 'page-attributes' )

    Also remember to add the ‘orderby’ => ‘menu_order’ and ‘order’ => ‘ASC’, to the following in your custom query:

    $args = array(
        'numberposts' => -1,
        'orderby' => 'menu_order',
        'order' => 'ASC',
        'post_type' => 'staff'
    );
    $staff = get_posts($args);

    I didn’t figure out a way to add classes to the p tags, but if you’re just trying to add them to be able to target them with css selectors, I suggest using ‘child’ pseudo classes: https://css-tricks.com/how-nth-child-works/

    For example in my scss code I’m targeting the name, email and submit inputs in the following way:

    // child pseudo classes give explicit style and positions to nsu form inputs and submit buttons
    .nsu-form {
    
    		p {
    			&:first-child { // p tag wrapping name input
    				position: relative;
    				width: 50%;
    				float: left;
    			}
    
    			&:nth-child(2){ // p tag wrapping email input
    				position: relative;
    				width: 50%;
    				float: right;
    			}
    
    			&:last-child { // p tag wrapping submit input
    				position: relative;
    				width: 50%;
    				float: right;
    			}
    
    		}

    Hope that this helps. If you don’t know scss conventions, basically the above is the same as p:first-child { } .. p:nth-child(2) {} .. etc

    I encountered the same error, basically the PHP function “split” has been deprecated in PHP vers. 5.3.

    To fix this error you’ll have to edit the above file “wpseo-functions.php”

    Find line 306 and replace split with explode:

    //$clean_slug_array = array_diff ( split( " ", $clean_slug ), wpseo_stopwords() );
    
      $clean_slug_array = array_diff ( explode( " ", $clean_slug ), wpseo_stopwords() );
    Thread Starter tnoguchi

    (@tnoguchi)

    Okay, this was totally a CSS issue and not, what I had earlier thought, a problem with my PHP.

    Thread Starter tnoguchi

    (@tnoguchi)

    A follow-up. I looked at the underlying html being produced. There’s actually nothing wrong with it technically. Each of the thumbnails, excerpts and post-meta is being produced. For some reason this seems to be a bug in Chrome?

    FF seems to be rendering the page more or less correctly. However, even though the code is correct, Chrome is repeating the first li panel content over and over.

Viewing 15 replies - 1 through 15 (of 31 total)