Nobble
Forum Replies Created
-
@stoupon,
I will make some time next week to upload it, it still needs a bit of work as a theme, I had to pause the development because of work (it’s based off the gtd p2 variation btw) but I think you’ll be able to copy some of the code to get where you want to be.
Forum: Plugins
In reply to: Dropdown Category Selection for Publishing Posts in P2 theme v.1.1.3I hadn’t tested the code with version 1.1.5 yet but I may upload a p2 modified version for it next week if I can create the time. Without seeing your code it is hard to say what’s not working.
Keep in mind that to accomplish this with P2, theme edits will be required as well, as p2 pushes posts as updates to users screens via jquery regardless who that post was intended for.
Some time ago I created a variation of P2 that does what you’re trying to do. My approach was to automatically allocate a category matching the users’ id whenever a post is made and to then filter the output based on categories so that users can only see my posts and their own. I had to modify some JS to make sure users didn’t see pushed updates from other users. It works great but there’s quite a bit of customisation work there.
Forum: Themes and Templates
In reply to: Page tabs in P2, like an “About” pageI’d be looking to create a child theme. This is how the P2 team had envisioned theme developers making customisations like this. If you aren’t familiar with editing/modifying themes, I’d ask a theme developer to do it for you. Page tabs like you are describing aren’t hard to do though.
Forum: Fixing WordPress
In reply to: P2 style content creation in front end for normal themesI think you’ve asked an impossible question, if it can’t be a plugin, I’m not sure how you see that being implemented.
Forum: Themes and Templates
In reply to: change post category?Forum: Plugins
In reply to: Dropdown Category Selection for Publishing Posts in P2 theme v.1.1.3If you need to force a category choice from the drop down box:
add this to post-forms.php:
<label class="cat-error" for="dropcat" id="dropcat_error"></label>
I put it directly after the drop down selection.
note that the class ‘cat-error’ defines the display through css for the warning message.in p2.js you’ll need to rearrange one line we added before:
$drop_cat= $_POST['drop_cat'];
and place it earlier inside the function, with a few new lines. Find the line that states:
if(jQuery('.no-posts')) jQuery('.no-posts').hide();
and add this straight after that line:
var drop_cat = $('#drop_cat').val(); // assigns the drop category value if ("" == drop_cat) { // checks the drop category value, if empty, will pass a message $("label#dropcat_error").text('Please select a category').show().focus(); return false; }
This should work but keep in mind this kind of defeats the purpose of the post types/tab functionality p2 uses.
Forum: Plugins
In reply to: Dropdown Category Selection for Publishing Posts in P2 theme v.1.1.3Here goes:
in p2.js go to line 217 which should show:
var args = {action: 'new_post', _ajax_post:nonce, posttext: posttext, tags: tags, post_cat: post_cat, post_title: post_title, post_citation: post_citation };
replace this with:
var drop_cat = $('#drop_cat').val(); var args = {action: 'new_post', _ajax_post:nonce, posttext: posttext, tags: tags, post_cat: post_cat, drop_cat: drop_cat, post_title: post_title, post_citation: post_citation };
in ajax.php, find around line 155:
$accepted_post_cats = apply_filters( 'p2_accepted_post_cats', array( 'post', 'quote', 'status', 'link' ) ); $post_cat = ( in_array( $_POST['post_cat'], $accepted_post_cats ) ) ? $_POST['post_cat'] : 'post';
make a backup, or comment these lines out and replace with:
$drop_cat= $_POST['drop_cat']; $post_cat = $_POST['post_cat']; if ($drop_cat) { $post_cat = $drop_cat;} //if a category was selected from the drop down menu, this will become the category.
then we need to add the actual dropdown menu, in post-form.php add this before line 78 (before the form closes)
<select name="drop_cat" id="drop_cat"> <option value=""><?php echo attribute_escape(__('Select Category')); ?></option> <?php $categories= get_categories(); foreach ($categories as $cat) { $option = '<option value="'.$cat->category_nicename.'">'; $option .= $cat->cat_name; $option .= ' ('.$cat->category_count.')'; $option .= '</option>'; echo $option; } ?> </select>
In case you want to exclude categories you can control what categories are displayed by passing parameters to get_categories()
Forum: Plugins
In reply to: Dropdown Category Selection for Publishing Posts in P2 theme v.1.1.3I’ll see what I can do
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableThat works but I was using get_post initially because it enabled me to specify a page or post id and grab that content regardless of it’s post status. Get_post is more convenient for my usage scenario.
However, when I do
$custom_query = get_post( $my_page_id ); the_post(); //sets in_the_loop to true setup_postdata($custom_query); output etc
Now I have front end editor functional without having to touch its code, disregard the previous post. I’m doing more testing to see if my solution is working properly.
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableI’ve got my code and plugin working great when I comment out the in_the_loop() tag. I don’t suppose you could add the possibility of disabling the in_the_loop() check, through a setting? saves from having to tweak your plugin on every update.
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableI see, it works when in_the_loop() returns as true. Now I think I know how to fix it. Thanks Scribu!
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableUpdate:
I still haven’t figured out why front end editor doesn’t grab the_excerpt, the_title() and the_content() consistently from the sidebar widgets. In testing with other sites, I noticed it sometimes will work (in my cases it worked when there were no regular loops being used (the custom template I created consisted just of widget areas no other content/loops), in fact I had it work with my initial get_post code.What could cause front end editor to not wrap the content/title/excerpt even if it is outputted through the corresponding functions or with the right filters?
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableI’ve tried both 2.7.1 and the dev version. It’s working on my dev site (uses thesis theme) but fails on the other sites I’ve tried.
I’ve also tried testing
<?php $postslist = get_posts('numberposts=2&order=ASC&orderby=title'); foreach ($postslist as $post) : setup_postdata($post); ?> <div> <?php the_date(); ?> <br /> <?php the_title(); ?> <?php the_excerpt(); ?> </div> <?php endforeach;?>
with the same results, title and excerpt etc aren’t editable. They don’t get wrapped by front end editor on my installs. Puzzling…
Forum: Plugins
In reply to: [Plugin: Front-end Editor] Making fields retrieved with get_post editableHey Scribu,
I switched from using get_post to a loop a la
$loop = new WP_Query('your query vars here'); while ( $loop->have_posts() ) : $loop->the_post(); ... rest of code here ... endwhile;
And it now works on my development site but not on other sites I’ve tried it on, with the exact same code and plugin settings…and I can’t figure out why. For some reason Front-end editor is not wrapping it’s classes around the_excerpt(), the_title() and the_content() for my custom loop (it is for the default loops in theme though). Do you have any idea on what might be causing conflicts/what to look for?
ps. Love that post thumbnails are now editable, it′s working great!