luckdragon
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Title questionyes
Forum: Fixing WordPress
In reply to: Title questiondo this:
instead of $mycount++ put:$mycount = ($mycount ? 0 : $mycount++);see if that helps
Forum: Fixing WordPress
In reply to: Title questionlike I said, the in_the_loop() check should do it…
I wonder..
global $wp_query,$bigtitle,$mycount; $mycount++;then:
if ($_SESSION['kw'] && in_the_loop()) $title .= ' '.$_SESSION['kw']." ".$mycount;check several pages, and see if the number that is after the title on the page is always the same..
if it is, tell me the number please.
Forum: Fixing WordPress
In reply to: Title questionok, let’s try this then:
<h1><?php global $bigtitle; $bigtitle = 1; echo get_the_title($ID); $bigtitle=0;?></h1>then in the function:
global $wp_query,$bigtitle;
andif ($_SESSION['kw'] && in_the_loop() && $bigtitle == 1) $title .= ' '.$_SESSION['kw'];Forum: Fixing WordPress
In reply to: Title questionis that menu a widget? or a custom menu? or what? how is it created?
Forum: Fixing WordPress
In reply to: Title questionor maybe is_page, but technically, in_the_loop should do that
Forum: Fixing WordPress
In reply to: Title questionhmmm… that in_the_loop() code should do that.. maybe change in_the_loop to is_single?
Forum: Fixing WordPress
In reply to: Title questionyes, change this:
if ($_SESSION['kw']) $title .= ' '.$_SESSION['kw'];
to this:
if ($_SESSION['kw'] && in_the_loop()) $title .= ' '.$_SESSION['kw'];Forum: Fixing WordPress
In reply to: Title questionok, let’s try it this way..
first off, delete the code you have now, and just have:
<h1><?php echo get_the_title($ID); ?></h1>in your wp-config.php at the very top (on a line right after the <? and before the /*) put:
session_start();then, in functions.php for your theme:
function my_set_new_title($title) { global $wp_query; if ($wp_query->query_vars['kw'] || $_GET['kw']) { $_SESSION['kw'] = ($wp_query->query_vars['kw'] != "" ? $wp_query->query_vars['kw'] : $_GET['kw']); } if ($_SESSION['kw']) $title .= ' '.$_SESSION['kw']; return $title; } add_filter('the_title','my_set_new_title');Forum: Fixing WordPress
In reply to: Title questiongive me the url so I can see what it is doing.. then there might be another way to do it..
Forum: Fixing WordPress
In reply to: Title questionchange $_GET[‘kw’] to $title;
<h1><?php echo get_the_title($ID); ?> <? echo $title; ?></a></h1>see if that helps
Forum: Fixing WordPress
In reply to: Title questionwhy are you putting this:
<? echo $_GET['kw'] ?>if you just assigned it to $title then why are you not using $title?Forum: Fixing WordPress
In reply to: Title questionI don’t see my code anywhere..
if(trim($_GET['kw'])!=''){ $_SESSION['kw'] = $_GET['kw']; } if (trim($_SESSION['kw']) != '') { $title=trim($_SESSION['kw']); }Forum: Fixing WordPress
In reply to: Title questionright now, you’re testing for the GET variable, you can set a SESSION variable and test for that, which will carry through the site
I’m assuming that you have a function doing it, just do something like:
if ($_GET['kw']) { $_SESSION['kw'] = $_GET['kw']; } if ($_SESSION['kw']) { your title stuff goes here }Forum: Fixing WordPress
In reply to: get_option and php tagsyou’re not trying to run code on the get_option, you’re trying to run the get_option within code, so php-exec should work for you.
php-exec executes the code within the tags. which is what you’re trying to do, you’re not trying to have code run when the get_option function is being called.