Forums

php for dynamic post titles/categories (4 posts)

  1. lockdownd7
    Member
    Posted 2 years ago #

    Hi,

    What would I have to do to use some php to dynamically create post info such as title, category, etc.?

    What files would I need to edit?

    Thanks

  2. esmi
    Theme Diva & Mod
    Posted 2 years ago #

    Your theme files, presumable. What are you trying to do?

  3. lockdownd7
    Member
    Posted 2 years ago #

    Well right now I'm using php in the body of a post to generate a post of randomly selected content.

    So I need to be able to match the randomly generated post content with appropriate, corresponding title and category info, which would be simple enough if I knew where to put the code.

    I see that I can make those changes in the theme files, however, this doesn't change the actual post title, just the output the surfer sees. Although that might not matter, I'm not completely sure. Where is the post title actually generated? I was thinking in wordpress's post.php file but I couldn't tell, there's so many functions in use. :/

  4. esmi
    Theme Diva & Mod
    Posted 2 years ago #

    Depending upon how you intend to use this - as the main Loop or as an additional loop, you might want to have a look at:

    http://codex.wordpress.org/Template_Tags/query_posts
    http://codex.wordpress.org/Template_Tags/get_posts

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.