Forum Replies Created

Viewing 7 replies - 481 through 487 (of 487 total)
  • Thread Starter hommealone

    (@hommealone)

    Hi again Scott,

    I finally was able to get this to work using my ‘if’ statement within the loop, but I’d like to understand how to use the ‘where’ in find() as you suggested; I suspect this will put less load on the server as well?

    So this works:

    <?php
    $params = array(
        'limit' => -1,
        'orderby' => 'resource_resource_name ASC'
    );
    $resources = pods('resource', $params);
    ?>
    
    <?php while ( $resources->fetch() ) : ?>
    <?php if ( has_term( 'my_region','regions', $resources->id() ) ) : ?>
        <?php
          // set our variables
    	  //my variables are here
        ?>
    <div class="resource" id="resource-<?php echo str_replace(" ","-",$resource_resource_name); ?>">
    <!-- (This is where the content goes.) -->
    </div>
    <!-- /.resource -->
    <?php endif; ?>
    <?php endwhile; ?>

    But this doesn’t work (it outputs nothing), though I thought it would:

    <?php
    $params = array(
        'limit' => -1,
        'where' => "regions.name = 'my_region'",
        'orderby' => 'resource_resource_name ASC'
    );
    $resources = pods('resource', $params);
    ?>
    
    <?php while ( $resources->fetch() ) : ?>
        <?php
          // set our variables
          // my variables are set here...
        ?>
    <div class="resource" id="resource-<?php echo str_replace(" ","-",$resource_resource_name); ?>">
    <!-- (This is where the content goes.) -->
    </div>
    <!-- /.resource -->
    <?php endwhile; ?>

    I’m suspecting that this is because the ‘where’ is looking in the ‘resources’ pod, rather than in the ‘regions’ taxonomy?

    Any suggestions?

    p.s. – senyoraangelica: thanks but I couldn’t find anything in the code you referenced that helped either.

    Thread Starter hommealone

    (@hommealone)

    I tried this, but no luck… :

    <?php
    $params = array(
        // Be sure to sanitize ANY strings going here
        'where'=>"regions.name = 'regional_resources'"
    ); 
    
    $resources = pods('resource', $params);
    $resources->find('resource_resource_name ASC');
    ?>
    
    <?php while ( $resources->fetch() ) : ?>
        <?php
          // set our variables
          $resource_resource_name			= $resources->field('resource_resource_name');
          $resource_contact_name_title		= $resources->field('resource_contact_name_title');
    	  $resource_address					= $resources->field('resource_address');
    	  $resource_phone					= $resources->field('resource_phone');
    	  $resource_fax						= $resources->field('resource_fax');
    	  $resource_e_mail					= $resources->field('resource_e_mail');
    	  $resource_website					= $resources->field('resource_website');
    	  $resource_additional_information	= $resources->field('resource_additional_information');
    
    	  // data cleanup
    	  $resource_additional_information       = wpautop( $resource_additional_information );
    	  //$member_photo     = $member_photo[0]['guid'];
        ?>
    <div class="resource" id="resource-<?php echo str_replace(" ","-",$resource_resource_name); ?>">
    <?php if ($resource_resource_name) : ?>
    <h4><?php echo $resource_resource_name; ?></h4>
    <?php endif; ?>
    <?php if ($resource_contact_name_title) : ?>
    <p><?php echo $resource_contact_name_title; ?></p>
    <?php endif; ?>
    <?php if ($resource_address) : ?>
    <p><?php echo nl2br($resource_address); ?></p>
    <?php endif; ?>
    <?php if ($resource_phone) : ?>
    <p>Phone: <?php echo $resource_phone; ?></p>
    <?php endif; ?>
    <?php if ($resource_fax) : ?>
    <p>Fax: <?php echo $resource_fax; ?></p>
    <?php endif; ?>
    <?php if ($resource_e_mail) : ?>
    <p>Email: <?php echo str_replace("@"," [at] ",$resource_e_mail); ?></p>
    <?php endif; ?>
    <?php if ($resource_website) : ?>
    <p>Website: <a href="https://<?php echo $resource_website; ?>" target="_blank"><?php echo $resource_website; ?></a></p>
    <?php echo $resource_additional_information; ?>
    <?php endif; ?>
    </div>
    <!-- /.resource -->
    <?php endwhile; ?>

    Thread Starter hommealone

    (@hommealone)

    I’m afraid that you’re over-estimating my skills in PHP. I don’t know what that means, I’m afraid…

    Thread Starter hommealone

    (@hommealone)

    Scott,
    Thanks for the suggestion, but I’m afraid that didn’t do it. Even with your addition, I’m still getting ALL of the CPT items, rather than only those with the taxonomy term I’m trying to filter for.

    I was only guessing that nesting that “if” statement inside of the “while” statement would be the way to go. Does that even make sense? Considering the logic in those statements, I’m not understanding why I’m seeing all of the CPT items. If anything, I’d expect to see none rather than all of them…?

    Thread Starter hommealone

    (@hommealone)

    Thanks! I’m not working this weekend but will try that out next week and report back on how it worked!

    Thread Starter hommealone

    (@hommealone)

    Apparently the similar plugin TinyMCE Advanced had the same problem. I found some information in this TinyMCE Advanced forum post:
    [resolved] Advanced link popup drop downs empty

    Following the suggestion of everville, I edited the WP Super Edit file:
    wp-super-edit/tinymce_utils/tiny_mce_popup.js

    Replacing…

    tinymce.dom.Event._add(document, "focus", function () {

    With…

    tinymce.dom.Event.add(document, "focus", function () {

    and that fixed my problem.

    I know that editing the file in the plug-in will mean that the fix will go away the next time I update the plug-in, but hopefully the plugin author will have this fixed by then.

    Sorry I am coming into this late. I just (Feb 24 2013) updated a WP site to 3.5, and WP Super Edit (2.4.6) is still broken. Is this issue still unresolved?

    If this issue has been resolved for everyone else, how can I fix my version?

    (I tried Samuel Wood’s suggestion above but it did not work.)

Viewing 7 replies - 481 through 487 (of 487 total)