WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] dynamically copy the_title into the_content in a post (4 posts)

  1. piasmith
    Member
    Posted 2 years ago #

    First of all thank you to all you guys answering all these questions.

    I am trying to do the following in a post.

    <add img>
    <add iframe>
    <h1>
         <?php the_title(); ?>    <-this is what I am trying to do
    </h1>
    <add another img>
    <then some text> ....

    I don't know enough about php at this point to know why it doesn't work, but is there a way to make it work?

    Just to be clear I do not want to move it, I just want it to also appear dynamically in the_content.

    Thank you,

    [Please post code snippets between backticks or use the code button.]

  2. chadrew
    Member
    Posted 2 years ago #

    Normally you can't use PHP in WordPress posts.

    I suppose you could use this plugin:

    http://wordpress.org/extend/plugins/exec-php/

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    shortcode might be another option

    http://codex.wordpress.org/Shortcode_API

  4. piasmith
    Member
    Posted 2 years ago #

    Thank you Chadrew. The plug-in seemed to work but the when I added something or edited. The php became text. I changed the class of entry div on the index page, I don't know if there is a reference to that and that way why it didn't work on the index page but did work on the single page. And as there was a million or so different files that could be hidden in I decided to do something else for now.

    Thank you alchymyth. I might try out the short code down the road.

Topic Closed

This topic has been closed to new replies.

About this Topic