Home
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
-
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();?> -
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; } ?>
-
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; } ?>
-
Now, you just need to use “Custome Fileds” to have these two features in your post/page:
-
Ticker
-
Subtitle
-
You can add some style to the code as well. Follow this instruction: