Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter DazVision

    (@dazvision)

    Cheers alchymyth,

    I had already used that hook and had copied the code from the wp-includes/formatting.php Then, as you suggested, I wrote a function to replace it: the only thing that I needed to change was the strip_tags function.

    However, I’m trying to find a option other than this. I noticed that the function wp_trim_excerpt hasn’t changed since 1.5, so that’s good news, but in the event that it does change in the future, I can’t guarantee it will work.

    Maybe it’s not even an option yet but it would be really cool to hook into ‘wp_excerpt_tags’ or something like that.

    Thread Starter DazVision

    (@dazvision)

    Unfortunately it isn’t working as originally thought. – PLEASE help ??
    After 3 weeks of the site being live they have a huge hit count but no real traffic to justify this – I started observing google analytics side-by-side with much smaller results.

    Here is the code that I have in the functions.php:

    function writecookies() {
       $file = (TEMPLATEPATH."/log.dat");
       $count_unique = 1;
       $cn = 'gacc';
       $count = intval(trim(file_get_contents($file)));
       if ($count_unique == 0 || !isset($_COOKIE[$cn])) {
          ++$count;
          file_put_contents($file, $count);
          setcookie( $cn, $cn, time()+43200, COOKIEPATH, COOKIE_DOMAIN, false, false);
       }
    }
    add_action('init','writecookies');

    What am I doing wrong with the code? Am I calling the wrong hook? Am I recording all spiders as visitors? Should I not be using php for the hit counter and instead maybe use javascript?

    ANY small hints in the right direction would be greatly appreciated, or even an answer.
    Thanks!

    Great solution, but I can’t seem to get it to work conditionally, ie ONLY on my page called ‘images’:

    if ( !is_page('images') ) {define('NGG_SKIP_LOAD_SCRIPTS', true);}
    else {define('NGG_SKIP_LOAD_SCRIPTS', false);}

    Am I missing something?

    Thread Starter DazVision

    (@dazvision)

    2 weeks later and the fix was very simple.

    Move the cookie code to the functions.php, add an action to the ‘init’ then output the results in the footer.

    Thread Starter DazVision

    (@dazvision)

    I found some code relating to WP-constants but still nothing ??
    setcookie($cn, 1, time()+3600, COOKIEPATH, COOKIE_DOMAIN);

    Please help if you know the answer.

    Just in case you were still searching, it was answered here. Just use conditional tags; so you were right to begin with ??

    Thread Starter DazVision

    (@dazvision)

    just an update, I found the function get_metadata() and have included a conditional statement within my foreach term loop as follows:

    $tgrade = get_metadata('taxonomy',$term->term_id,'tr_grade',true);
    if ($tgrade == $grade) {

    However, this is still very inefficient code as it still loops through all trophies per grade.

    I would like to query a taxonomy based on a taxonomy field, so, any takers?

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