Please Help Me

by 5 replies
6
i want make a random teks with php and i use in single.php

<?php
$random= array(' <?php the_title(); ?> details ','<?php the_title(); ?> info');
$rf=count($random) - 1;
$mlaku=rand(0,$rf);
$tampil = $random[$mlaku];
print $tampil;
?>

i want to call my post automatic but title post is none in my single post.

can anybody help for title that look at single post

#programming #php code
  • I'm not 100% sure what you are asking, but your code should be:

    <?php
    $random = array(get_the_title().' details ', get_the_title().' info');
    $rf=count($random) - 1;
    $mlaku=rand(0,$rf);
    $tampil = $random[$mlaku];
    print $tampil;
    • [1] reply
    • thank's very much now i'm understand..

      you are the best
  • hy.. thank for reply my thread but i have a problem..

    can you help me..

    i want to make a random content at single post. i'm use wordprees blog.

    i need like this..


    title = cat

    "my cat is sick, because i late give my cat eat. i very sad look my cat...."


    i mean is i want my title more 4 or 5 in 1 paragraft but when i make 2 title in 1 paragraft my wordpress eror.
    • [1] reply

    • Just continue using the_title().

      "My the_title() is sick because I late give my the_title() eat..."
      • [1] reply

Next Topics on Trending Feed