Using html in post title with custom fields

I want to be able to use html in my title. I found a work-around that makes use custom fields with a modification in single.php on a standard theme. X is anything but standard. Here is what I was trying to implement. Can you lend a hand?

The instructions take the <h1><php the_title(); ?></h1> and replace it with `<?php

$html_title = get_post_meta($post->ID, “HTML_title”, true);

if ($html_title) { ?>

  <h1><?php echo $html_title; ?></h1>
<?php } else { ?>
  <h1><?php the_title(); ?></h1>
<?php } ?>`

Allowing a custom field called HTML_title.

I looked in the single.php file for X and found just this code. <?php x_get_view( x_get_stack(), 'wp', 'single' ); ?>

Can you tell me how to make the change I trying to accomplish?

Thanks team

Hi there,

To do such a change you will need to install the Child Theme first. Then you will need to overwrite the file below from the parent theme. Copy the file below:

wp-content/themes/x/framework/views/{stack name}/_content-post-header.php

to:

wp-content/themes/x-child/framework/views/{stack name}/_content-post-header.php

You will need to replace {stack name} with the name of the stack you are using all in lowercase. For example: integrity

If you do not see the folders mentioned in the child theme you should create those folders there.

Now you can change the code and replace the_title() with whatever code you have on your mind.

Please kindly consider that this is a customization request and we will not be able to implement this feature for you as it is outside the scope of our support.

Thank you for your understanding.

Thank you for that.

You’re welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.