Results 1 to 2 of 2

Thread: Break Title Using PHP

  1. #1
    Thread Starter
    Expired Customer jatun2's Avatar
    Join Date
    Sep 2012
    Location
    Canada
    Posts
    169
    Thanks
    19
    Thanked 6 Times in 5 Posts

    Break Title Using PHP

    Hello,

    I'd like to break my Listings Page Titles as they wrap.

    I.E. MAIN TITLE
    Sub-Title here

    Using <br /> works but it affects the breadcrumb.

    I tried to impliment this found at Stackflow but didn't get it working.

    In functions.php
    Code:
    /*
     * Split and wrap title
     */
        function get_split_title($postID) {
            $title = get_the_title($postID);
            $lines = explode(' – ', $title);
            $output = false;
            $count = 0;
    
            foreach( $lines as $line ) {
                $count++;
                $output .= '<span class="line-'.$count.'">'.$line.'</span> ';
            }
    
            return $output;
        }
    and

    in page.php in title area

    Code:
    <?php echo get_split_title($post->ID); ?>
    I also tried:
    Code:
    <a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr('', 0, 40), $newtitle = str_replace(" | ", "</br>", $title);?></a>
    between the <h1> tags in page.php (both child and core) and nada. Yes, I separated the tittle | subtitle with the pipe " | "

    Any help would be greatly appreciated.

  2. #2
    Thread Starter
    Expired Customer jatun2's Avatar
    Join Date
    Sep 2012
    Location
    Canada
    Posts
    169
    Thanks
    19
    Thanked 6 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Break up listing on application page
    By malave in forum Help Using JobRoller
    Replies: 3
    Last Post: April 10th, 2013, 10:26 AM
  2. Google Maps address with line-break
    By ferryheijnen in forum Report ClassiPress Bugs
    Replies: 5
    Last Post: November 7th, 2011, 04:31 PM
  3. Break down ads per category and display them on a page
    By pawel in forum ClassiPress General Discussion
    Replies: 2
    Last Post: September 20th, 2011, 04:37 AM
  4. Wordpress 3.0.3 seems to break lots of things...
    By xenogeek in forum Report ClassiPress Bugs
    Replies: 6
    Last Post: December 8th, 2010, 10:36 PM
  5. How do I add More.... break to text widget?
    By andyclassipress in forum Help Using ClassiPress
    Replies: 2
    Last Post: June 15th, 2010, 04:48 PM