DazVision
Forum Replies Created
-
Forum: Hacks
In reply to: Exerpt to allow html tags, eg <a>? Non-core hackCheers 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 thestrip_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.
Forum: Hacks
In reply to: Having trouble setting a cookie within wordress.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!Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Disable all scripts and stylesGreat 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?
Forum: Hacks
In reply to: Having trouble setting a cookie within wordress.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.
Forum: Themes and Templates
In reply to: Having trouble setting cookie in wordress: hit counterI 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.
Forum: Fixing WordPress
In reply to: Enqueue scripts on certain pages onlyJust in case you were still searching, it was answered here. Just use conditional tags; so you were right to begin with ??
Forum: Themes and Templates
In reply to: How to query specific custom fields within a custom taxonomy?just an update, I found the function
get_metadata()
and have included a conditional statement within myforeach 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?