nat3
Forum Replies Created
-
I’m using the latest version of Chrome on Mac. I haven’t tried any other browsers.
If this isn’t the expected behavior, then I take it’s a bug?
Forum: Fixing WordPress
In reply to: Global variables in WordPress?run the code once at the top of the page. Put its output in an array that can be accessed elsewhere on the page and have the rest of the code on the page access the values in the array rather than rerun the code each time.
Exactly! That’s what I’m wanting to do!
I tried to do this by putting
<?php global $headerVar = 'is this going to work?'; ?>in wp_head and then putting
<?php echo 'hv: ' . $headerVar; ?>in a widget, but the output is just “hv,” so it’s not working.
Forum: Fixing WordPress
In reply to: Global variables in WordPress?Thanks for your reply!
If I put my php code in a shortcode function, then it’s still going to run many times for the same page, right? Maybe I’m missing something.. I’m just looking for a way to have the code run once and then a few variables from the code be accessible to whatever else loads on the page.
Forum: Plugins
In reply to: I need an F.A.Q. plugin!Do you think any of the free ones are as good as the $25 one?
Forum: Fixing WordPress
In reply to: How to get the page name?This worked:
global $post; $pagename = $post->post_name; echo 'page name: ' . $pagename;Thank you so much!!
Forum: Fixing WordPress
In reply to: How to get the page name?I tried putting this in my page:
$pagename = $post->post_name; echo('page name: ' . $pagename);But the output is
page name:I think my php code might be outside “the loop.” I’m not sure, though, because
<?php echo get_option('home'); ?>works fine.Thanks for your help.
Does anyone know if this can be used outside of a post or wordpress page?
I thought I’d mention that I tried commenting out the below code:
// Link - additional code courtesy of Martin Downer if( get_post_meta($page_found->ID, $link, true) ){ // We have an external/manual link $output .= "\n\t" . '<a href="'. get_post_meta($page_found->ID, $link, true) .'" title="Read More" class="open"></a>'; } else { $output .= "\n\t" . '<a href="'. get_permalink($page_found->ID) .'" title="Read More" class="open"></a>'; }But then the DCG is just black on the page.