WordPress.org

Ready to get started?Download WordPress

Forums

content data path (3 posts)

  1. DPoncy
    Member
    Posted 3 years ago #

    This may be a dumb php newbie question, but how can I get a path to the content. I don't need the actual content, just the path for a javascript call.

    Any help would be greatly appreciated

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    There isn't "a path". The post content is pulled from the database.

  3. DPoncy
    Member
    Posted 3 years ago #

    Is there a way to fake a path. I have tried to put a wordpress loop in a file called "chapter.php" and then used it like this:


    var bookData = {
    getComponents: function () {
    return [
    "<?php bloginfo('template_url'); ?>/chapter.php"
    ];
    },
    getContents: function () {
    return [
    {
    title: "<?php the_title(); ?>",
    src: "<?php bloginfo('template_url'); ?>/chapter.php"
    }
    ]
    }


    <p>But the php functions aren't recognized.</p>
    <p>This code wasn't designed for dynamic data and I am trying to adapt it.`

Topic Closed

This topic has been closed to new replies.

About this Topic