kdhk
Forum Replies Created
-
Forum: Themes and Templates
In reply to: explode function not working in wordpress loopIt worked when i used ascii character of ‘|’ as following
<?php $tit = the_title(‘ ‘,’ ‘,0);
$arr = explode(‘|’,$tit);
?>I tried this previously but i think i use without quotes or instead of
the_title(‘ ‘,’ ‘,0); ,i used the_title();Thanks a lot alchymyth
Forum: Themes and Templates
In reply to: explode function not working in wordpress loopthe output of the whole test sequence that u suggested is the whole title.
i can’t test if ‘space’ works bcoz the title returned has the seperator as ‘|’ by default.
as i mentioned before if i try without the_title(”,”,0) i mean if i use string directly as
$tit = ‘motorola placement paper | motorola interview question papers’
it is working perfectly
Forum: Themes and Templates
In reply to: explode function not working in wordpress loopyes , $tit contains the title.
the_title(‘ ‘,’ ‘,0); is returing the titlebut explode worked perfectly if i use the string directly as
$tit = ‘motorola placement paper | motorola interview question’Forum: Themes and Templates
In reply to: explode function not working in wordpress loopI tried with full <?php tag also.It didn’t work.
Forum: Themes and Templates
In reply to: explode function not working in wordpress loopI got the same output with my prev code,it is not splitting the string.
For exampl if i hav the ‘post title’ as
‘motorola placement paper | motorola interview question | motorola interview previous papers’
i want to retrieve the first part before ‘|’.
i want the result as
‘motorola placement paper’ only.It is working outside
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
but not within