• Hello all, I have modified the P2 theme to include a post title in the post-form.php, now, it seems that the tag form does not work anymore.

    Here is the code I am using:

    I translated it to Spanish for my site, and I added a word counter to the post box. But the main modification was the addition of the title.

    Any ideas why this is happening?

    <?php
    $user = get_userdata( $current_user->ID );
    $name = isset( $user->first_name ) && $user->first_name? $user->first_name : $user->display_name;
    ?>
    
    <div id="postbox">
    	<form id="new_post" name="new_post" method="post" action="<?php bloginfo( 'url' ); ?>/">
    		<input type="hidden" name="action" value="post" />
    		<?php wp_nonce_field( 'new-post' ); ?>
    		<div class="avatar"><?php echo prologue_get_avatar( $user->ID, $user->user_email, 48 ); ?></div>
    		<div class="inputarea">
    			<label for="posttext"><?php printf( __('Hola %s. Cual es tu historia?', 'p2'), wp_specialchars( $name ) ) ?></label>
    			<div class="postrow" id="post-bar-title">
    				<input id="my_title" type="text" autocomplete="off" value="" tabindex="1" size="30" name="my_title" />
    				<span id="regla_titulo">Ponle un título (40 caracteres)</span>
    			</div>
    			<div>
    				<textarea name="posttext" id="posttext" class="count[50]" tabindex="1" rows="3" cols="60"></textarea>
    			</div>
    			<label class="post-error" for="posttext" id="posttext_error"></label>
    			<div class="postrow">
    				<input type="text" name="tags" id="tags" tabindex="2" autocomplete="off" value="<?php echo attribute_escape(__('No olvides las etiquetas', 'p2')); ?>"
    					onfocus="this.value=(this.value=='<?php echo js_escape(__('No olvides las etiquetas', 'p2')); ?>') ? '' : this.value;" />
    				<input id="submit" type="submit" tabindex="3" value="<?php echo attribute_escape(__('Publicar', 'p2')); ?>" />
    			</div>
    <div id="reglas">
    Tu historia no debe exceder las 100 Palabras, ponle un título y coloca las palabras clave!</li>
    Si tu historia no aparece publicada inmediatamente, no desesperes, es que aun no ha sido revisada. Es por seguridad.
    </div>
    			<span class="progress" id="ajaxActivity"><img src="<?php bloginfo('template_directory'); ?>/i/indicator.gif"
    				alt="<?php echo attribute_escape(__('Loading...', 'p2')); ?>" title='<?php echo attribute_escape(__('Loading...', 'p2')); ?>'/></span>
    		</div>
    		<div class="clear"></div>
    	</form>
    </div> <!-- // postbox -->

    I’m using wp 2.8.6 and P2.

    Thanks in advance for any input you may have.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mikeboy3

    (@mikeboy3)

    anyone? please help, it is important.

    I tried undoing the modifications, but to no avail. I upgraded to WP 2.9 BETA1, but nothing, any ideas?

    mike,
    what do you mean by tag not working anymore? does it not adding any tag or the input box doesn’t even show up now?

    does it not adding any tag or the input box doesn’t even show up now?

    The box do show, but when I put the tags in the box, after don’t show.

    PD: sorry for my English, I’m Administrator of the website, too.

    Thread Starter mikeboy3

    (@mikeboy3)

    All forms display on the site.

    The user’s add the Title, the post-content, and fills up the tags, however, when they publish the post, the tags are not included, only the title and the content…

    I noticed that after a user hits Publish, the Title and content boxes are emptied, however, the Tag box keeps the tags, it’s not blank again.

    Thanks for your reply

    check p2.js and functions.php to see if the tags are being recorded properly. We can’t tell just form the code above.

    One way to spot changes is to run a text compare on the original p2 theme and your modified version. I do this using notepad++ and a compare text extension, it highlights all the differences. You might be able to track down what you might have broken. You’ll need to watch p2.js, functions.php and postform.php especially.

    fiy, p2 version 1.1 was released on wordpress.com a few days ago, I don’t know when it’s available on .org, but that also gives users the ability to post with titles or not.

    Thread Starter mikeboy3

    (@mikeboy3)

    Thank you Nobble, I kept on working on it and I now have a working version, thanks in great part to omarvelous:
    http://github.com/omarvelous/p2_two

    He modded the theme and added title, category support, so I used his work as an example for my modifications.

    I’m waiting for the new P2 to come out, it handles post types, so you can define status and blog posts as different inputs, one without titles, and a blog post with titles, categories, uploads, etc…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tags are broken after modification to P2 theme’ is closed to new replies.