Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter donnietheg

    (@donnietheg)

    Thanks @mattpramschufer ! That worked.

    For others, I made a taxonomy for the pay-per-post post and used it for the pages that the pages the pay-per-post post gives access to. I needed to simply get the id of the corresponding pay-per-post post when in the one of the pages. Here is how it looks…

    <?php  // get the episode_level taxonomy term of the current Level page (e.g. intermediate)
        $terms = get_the_terms($post->ID, 'episode_level');
        if (!empty($terms)) {
          $term = array_shift($terms);
        }
        $episode_free   = get_field('episode_free'); // check if this episode has acf radio button field selected as free
        $level          = $term->slug;
        
        // Prepare to HIDE THIS EPISODE PAGE content if user has not purchased the parent Level
        // Check the value of episode_level taxonomy and define the corresponding the hardcoded id of the parent Level post
        if ($level == 'beginner') :
          $level_purchased_id = 190; // IMPORTANT: change these hardcoded ids to correspond to the Pay-Per-Post page which is the parent of the episode
          elseif ($level == 'intermediate'):
          $level_purchased_id = 187;
          elseif ($level == 'advanced'):
          $level_purchased_id = 189;
          elseif ($level == 'master'):
          $level_purchased_id = 188;
        endif;
        if(Woocommerce_Pay_Per_Post_Helper::has_access($level_purchased_id) or ($episode_free == 'isfree')): // if the user has paid for this post or it is free display Episode content
        // Query custom-post Episode for this Episode single page (e.g./level/intermediate/)
    while (have_posts()) : the_post(); ?>
    [my page code here]
    endwhile; 
          // This is what users who have not paid for the parent Level of this Episode see, or if the Episode is free
          else : echo('Sorry! You can not see this until you <a href="' . site_url() . '/wp-admin">&nbsp;login</a>&nbsp; or  <a href="' . site_url() . '">&nbsp;purchase it</a>.');
        endif; ?>
    
    Forum: Fixing WordPress
    In reply to: Fatal Error issue

    Ok, I have the same problem with W3 Total Cache. After installing the plugin I get this error:

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/equitas/public_html/wp-includes/load.php on line 337

    I am running WP 3.3 and the version of W3 Total Cache is 9.2.4

    I was able to get my site back up and running just like before the plugin install by deleting (or simply renaming) the following files:

    wp_content/advanced-cache.php
    wp_content/db.php
    wp_content/object-cache.php
    wp_content/w3-total-cache-config-preview.php

    and deleting the /w3-total-cache folder in wp_content/

    BUT, I still don’t have the W3 Total Cache plugin, which is what I want and need, because my WP site is running as slow as %$@££!!

    This is happening after a server transfer, so I am going to check if in the install on the old server I have the same problem or not.

    Thread Starter donnietheg

    (@donnietheg)

    After some work I ended up taking another attack on this problem. I posted elsewhere and resolved it. See:

    Thread Starter donnietheg

    (@donnietheg)

    That works great!

    I am using this to create a specif intro texts for each category and subcategory.

    I give the intro text post for a category or subcategory a slug name composed of the section number followed by “intro”, so for category 13 the slug for the intro post would be “13intro”

    (btw, I am editing editing category.php)

    With my additions the code looks like this

    <?php
    $postSlug = $this_category->cat_ID.”intro”;
    $postSlug = “name=”.$postSlug;
    $my_query = new WP_Query($postSlug);
    while ($my_query->have_posts()) {
    $my_query->the_post();
    // the_title(); // whatever you want to display the post here
    the_content(); // just like a normal Loop
    }
    ?>

    Thread Starter donnietheg

    (@donnietheg)

    Moshu, Thanks so much for your quick reply! That looks like the ticket for distinguishing between the 3 variants:

    -the content would also include a list of links: 1) for parent categories the links are the child categories, 2) unless the parent has no children, then the links are to the posts in the category, and 3) for the child categories the links are always the posts in that category.

    I will make three templates, using copies, I’ll assign the appropriate one to the specific pages in my hierarchy using the category-x.php option. I had read about category templates when I first started using WP (when I was only understanding a fraction of what I was reading) but had totally forgotten. That’s great.

    If it is okay, I will leave the topic as unresolved until I implement the solution. There are still all the other details related to programming each of the pages that I need a little time to be sure I have a handle on…

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