Forum Replies Created

Viewing 15 replies - 1 through 15 (of 5,345 total)
  • Ok. What you need to do is count the length of the content then decide whether to use the shortcode.

    if (100 < strlen($testimonial['testimonial-text'])) {
       echo do_shortcode('[expand]'.$testimonial['testimonial-text'].'[/expand]');
    } else {
       echo '<p>'.$testimonial['testimonial-text']'</p>';
    }

    That gives you a very simple count of the number of characters– letters, numbers, spaces, punctuation, etc– in the content. It will also count characters found in HTML markup, if any. It may not be sophisticated enough but that is the idea.

    Then what are you trying to do? If you add the shortcode to the custom meta field via the backend form you needn’t add it when you run do_shortcode. (Hopefully the brackets don’t get encoded). If you want to add it conditionally based on the length of the content then that is a different question than you originally asked.

    It is your hosting. You are looking at a network/server level configuration issue. WordPress couldn’t effect that if it wanted to.

    But I only want to invoke the code if the shortcode is present in the div.

    Just run do_shortcode() on your content. If no shortcode is present nothing will happen. I very much doubt that it is worth the effort to check first. At best you will see an execution difference 5 or 6 decimal places back and I am not sure which way it would fall. The overhead of searching your string and running a conditional may add some execution time or it may just be a wash.

    Replacing this,

    echo '<p>' . $testimonial['testimonial-text'] . '</p>';

    , with this,

    echo do_shortcode('[expand]'.$testimonial['testimonial-text'].'[/expand]');

    , should work. What have you tried? And what didn’t work? Sounds like your shortcode needs some Javascript too. Is that loading correctly?

    Yes, it works but it isn’t fixed.

    The problem is here: $this->user->active_blog = $this->user->blogs[get_current_blog_id()];

    That last bit of the object ‘blogs’ should be an array that looks something like this (illustrative only):

    array(
      '1' => 'aaa',
      '2' => 'bbb',
      '3' => 'ccc
    )

    If get_current_blog_id() is 1, 2, or 3 everything is fine. If it is 0, or greater than 3 you get that error. You are trying to access an array key that doesn’t exist. That is what ‘undefined offset’ means in this context. The code should check for the existence of that array key before trying to use it, as is done on the second line of the code you posted.

    You are welcome. Sorry it took such a long path and all day.

    Replace <?php the_content(); ?> with <?php // the_content(); ?>. That is a strange place for the_content() to be. If that fixes things you can delete the whole line.

    Wow… that is very different from what I was seeing before. The problem is right before the footer markup you posted and right after your sidebar.

    </ul>
        <!-- Unified into one widget area, as of 1.1.8 -->
        </div><!-- #primary .widget-area -->
    	<p><a href="http://mirrorme.me/burgundy-prints/dsc_0075-4/" rel="attachment wp-att-2892"><img src="http://mirrorme.me/wp-content/uploads/2012/10/DSC_0075.jpg" alt="" title="DSC_0075" width="3246" height="3656" class="alignnone size-full wp-image-2892" /></a></p>
    <p> <a href="http://mirrorme.me/burgundy-prints/#more-2640" class="more-link">(more…)</a></p>
    </div><!-- #container -->
       <footer id="footer" role="contentinfo" class="row">

    The last two lines are the beginning of the footer code. The </ul> is the end of your sidebar. Can you find the source code for that middle part? It should be whatever is including the footer, probably index.php.

    If you block currentlyobsessed.com’s jQuery ( http://currentlyobsessed.me/js/jquery/jquery-1.7.min.js ) the problem goes away. This is allowing all other Javascript to load, including WordPress’s own version of jQuery. The only place I see that script loading is in the iframe source here: ” http://currentlyobsessed.me/api/v1/get_widget?wid=30&blog=Mirror+Me&widgetid=3355 ” There are a number of embedded scripts in that file and I think one of them is copying information into what is probably supposed to be a hidden div. There does seem to be a connection. You claim things are different, or would be different, if you posted something else. I can’t evaluate that. If you would post another post or reset the iframe one to ‘draft’ I might be able to see something else.

    It is in your theme– “wp-content/themes/mytos/classes.php” on line 74. It is a non-fatal error so it should work with define('WP_DEBUG',false); as it should be on a live site. It should also be an easy proper fix if you want to paste lines 70-80 or so of “wp-content/themes/mytos/classes.php”.

    What that iframe does is pretty much completely determined by currentlyobsessed.com and by whatever mechanisms they have put in place for you to manipulate it, if any. You will probably need to look into the currentlyobsessed.com API or the widget that inserts the iframe (if it is inserted by a WordPress widget). You won’t be able to change this by editing your site, except by moving the iframe around or by editing the GET parameters of the iframe URL.

    About the duplicated footer, I think you have probably somehow managed to include footer.php more than once. It is hard to say exactly how but you are including a second copy of your <footer id="footer" class="row" role="contentinfo"> inside the first copy.

    If you even come close to a theme needing 256MB of memory then I would trow it out the window.

    Absolutely…

    I read somewhere that you can save it as a .jpg and it will show. And it did. Well, I can see it now.

    Originally this was an IE only item and it had to be an ICO file. Other browsers support favicons now and other formats are now supported but may not work in older (very old and god forsaken) browsers. Nonetheless, you had a TIFF not a JPEG. Those are not the same, and TIFF is not supported.

    It has changed to that because I wrote a new post. Before that, it was the first image in my previous post. It basically puts the first image from the post right above it there in the footer which I don’t understand.

    Sorry. No. That is not just an image. It is a complete iframe, and it is not displaying the same image as in the post above it. It is loading content from a completely different domain– a different website. Do you have any associate with “http://currentlyobsessed.me&#8221; because if you don’t then a plugin or your theme is leaching from your site or you’ve been hacked. Please answer this question.

    It is interesting that you are describing something very different than what I see. Try logging out and then looking at your site, as an experiment.

    Also, in case you don’t know, your footer shows up twice on ‘single’ post pages like this one: http://mirrorme.me/seven-leather-must-haves/#more-2681

    I don’t recall seeing this anywhere in WordPress Core. What plugins are you using?

Viewing 15 replies - 1 through 15 (of 5,345 total)