Skip to content
Ali edited this page May 25, 2016 · 1 revision

# Add Ticker and Subtitle to Wordpress pages and posts This instruction shows you how to add Ticker and Subtitle to Wordpress posts and/or pages

  1. Find the title of the post/page on the code of the theme (mostly located in the file index.php) For this reason you need to look for something like <?php the_title();?> or <?php single_post_title();?>

  2. Add the following code to the file (here index.php), exactly before the title as the Ticker:

    <?php
         $Ticker_value = get_post_meta( get_the_ID(), 'Ticker', true ); 
         if( ! empty( $Ticker_value ) ) 
         { echo $Ticker_value; }
    ?>
  3. Add the following code to the file (here index.php), exactly after the title as the Subtitle:

    <?php
         Subtitle_value = get_post_meta( get_the_ID(), 'Subtitle', true );
         if( ! empty( $Subtitle_value ) ) 
         { echo $Subtitle_value; }
    ?>
  4. Now, you just need to use “Custome Fileds” to have these two features in your post/page:

  • Ticker

  • Subtitle

  1. You can add some style to the code as well. Follow this instruction:

blog.namnam.ir/%D8%A7%D8%B6%D8%A7%D9%81%D9%87-%DA%A9%D8%B1%D8%AF%D9%86-%D8%B1%D9%88%D8%AA%DB%8C%D8%AA%D8%B1-%D9%88-%D8%B2%DB%8C%D8%B1%D8%AA%DB%8C%D8%AA%D8%B1-%D8%AF%D8%B1-%D9%88%D8%B1%D8%AF%D9%BE%D8%B1%D8%B3/

Clone this wiki locally