[Support request] Two-line post title

Home Forums Support [Support request] Two-line post title

Home Forums Support Two-line post title

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2317824
    Daniel

    If I simply add a snippet: echo str_replace(' | ', '<br />', get_the_title());, assign it to front end, then put a bar in my title where I want the line break, it should work, right?

    This is my | Two line Title

    Should become:

    This is my
    Two line Title

    It’s not working, for some reason.

    Based on this post, there is a way to do it using the Headline block (generateblocks, I assume). Here’s what I tried:

    1. Create new element, choose “Block”
    2. Element type = Hook? or Site Header? (I tried both)
    3. Create Headline block
    4. Select dynamic option = Title
    5. Select my location (in this case: Blog and Post)
    6. Select the Headline block that’s displaying the Title, and in Advanced > Additional CSS Class(es) add: dynamic-post-title
    7. add code snippet suggested by David, activate it on Front end
    8. Empty cache, refresh blog page and single post page that uses “|” as a line-break”

    Nothing changed for me. What am I missing?

    Thx

    #2317896
    Ying
    Staff
    Customer Support

    Hi there,

    If I simply add a snippet: echo str_replace(‘ | ‘, ‘<br />’, get_the_title());, assign it to front end, then put a bar in my title where I want the line break, it should work, right?

    No, it won’t. It’s not a function, it won’t affect any part of your site.

    The steps you listed seem right. Can you link us to your site where this element is activated?

    #2317956
    Daniel

    Should step#2 (Element) be set to Hook or Site Header? I currently have it set to Hook. I set up the post with the longest title to appear as a two-liner (notice the bar before the parenthesis).

    #2317961
    Daniel

    Ying, by the way, when I mentioned my snippet, I didn’t put the php tags in (since the snippet pluggin does that). So, the result would be: <?php echo str_replace(' | ', '<br />', get_the_title()); ?>. Still no good? (See this link).

    #2317968
    Ying
    Staff
    Customer Support

    Can you share the link to your site along with the login details?

    Should step#2 (Element) be set to Hook or Site Header?

    I don’t think site header is what you are after, this option will override the default site header entirely.
    You can choose any hook where you want the title to be.

    So, the result would be: <?php echo str_replace(‘ | ‘, ‘<br />’, get_the_title()); ?>. Still no good?

    No…Unfortuanly..

    It’s just outputting the title, you can put it in a hook element and tick the execute PHP box, select a hook and location, you will see what I mean ๐Ÿ™‚

    #2317991
    Daniel

    I want it to appear in the header exactly where the current title resides… I’ve been setting the Element to Hook and several hook names in the header category, but…nada. ๐Ÿ™‚

    #2318524
    Ying
    Staff
    Customer Support

    Can you share the link to your site? I haven’t been able to see your site yet.

    Let me know!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.