5 replies
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

#php code
  • Profile picture of the author kreitje
    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;
    Signature
    HitMyServer.com - Web, Email, Development
    HitMyServer.net - Web/Server Posts
    Do you have premium WordPress Plugins. Checkout my WordPress Plugin Manager for providing updates to your clients.
    {{ DiscussionBoard.errors[7555952].message }}
    • Profile picture of the author rexa5512
      Originally Posted by kreitje View Post

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

      <?php
      = array(get_the_title().' details ', get_the_title().' info');
      =count() - 1;
      =rand(0,);
      = ;
      print ;
      thank's very much now i'm understand..

      you are the best
      {{ DiscussionBoard.errors[7570480].message }}
  • Profile picture of the author rexa5512
    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.
    {{ DiscussionBoard.errors[7581031].message }}
    • Profile picture of the author Big Squid
      Originally Posted by rexa5512 View Post

      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.

      Just continue using the_title().

      "My the_title() is sick because I late give my the_title() eat..."
      {{ DiscussionBoard.errors[7585526].message }}
      • Profile picture of the author rexa5512
        Originally Posted by Big Squid View Post

        Just continue using the_title().

        "My the_title() is sick because I late give my the_title() eat..."
        can you replay my massage
        {{ DiscussionBoard.errors[7596201].message }}

Trending Topics