WordPress.org

Ready to get started?Download WordPress

Forums

Editing the post box (10 posts)

  1. adammcintyre
    Member
    Posted 4 years ago #

    Hi there!

    I want to use the P2 theme, http://wordpress.org/extend/themes/p2, but I want to extend the post box.

    I need two boxes - one to tell people 'put url here' and then another for 'description', however, when they click post, I want it to then post it all as one post, if you will?

    The reason being, the url will be a link to an MP3 which will convert to a player and then there will be the description of the track :-)

    Hope you can help!
    Adam.

  2. s_ha_dum
    Member
    Posted 4 years ago #

    Are you talking about posting from the backend or is this something your theme is showing on the front end?

  3. adammcintyre
    Member
    Posted 4 years ago #

    Hi apljdi,

    There is a post box, almost like Facebook, on the front end. Checkout the demo of the theme at http://www.p2theme.com

    Hope you can help bud!

  4. s_ha_dum
    Member
    Posted 4 years ago #

    Ok. That only shows up when you are logged in.

    Are you uploading the MP3s to your server of just linking to them? Linking is certainly easier, but either way you are going to have to do some theme editing. Start by digging through P2 and find where that form is created.

  5. adammcintyre
    Member
    Posted 4 years ago #

    just inserting a link, I'll be using that 1bit audio convertor which turns the link into a player. then the second box to be the description :-)

  6. adammcintyre
    Member
    Posted 4 years ago #

    Ok I've looked in the post form and I've got this :

    <div>
    <textarea name="posttext" id="posttext" tabindex="1" rows="1" cols="60"></textarea>
    </div>

    This is what makes the box which I can post with.

    This makes the post title however, so it won't convert to an mp3 player or what not.
    Is there a way to add an extra box that would make the post content?

    Cheers

  7. s_ha_dum
    Member
    Posted 4 years ago #

    That's only part of the form. By itself that won't do anything but make a box on the screen. You need the part that starts with <form and ends with </form>. Also, you need to be looking at the .php source, not at the browser's 'view source' output. I can't tell from what you've posted which you are looking at but the fact that there is no PHP in there makes me think its generated html source, not PHP source.

  8. adammcintyre
    Member
    Posted 4 years ago #

    there is a an extra file called post-form.php in the theme which is where I've got that from.

    http://whitelabel.ravemedics.com/wp-content/themes/p2/post-form.txt

    Thanks for helping bud, I'm not very key'd up on this sort of stuff! =D

  9. s_ha_dum
    Member
    Posted 4 years ago #

    Ok. In P2's functions.php there is a function called prologue_new_post(). That looks like what is doing your post insertion. Once you create your new field, you should have another $_POST value, say $_POST['videourl'] that you can fuse into the $post_content before this line: $post_id = wp_insert_post( array(. You'll have to fiddle with formatting, I'm sure. Also dig around that functions.php. There are serveral functions that deal with posting/post editing. You may have to modify more than one of them.

  10. suraj0008
    Member
    Posted 3 years ago #

    I am trying to put two custom fields for uploading audio as well as thumbnail but the files are not getting upload on the specified location.
    And I don't want to use any plug-in. This is a type of custom coding.

    Thanks In Advance

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.