Twansparant
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Preview draft not working with different Site Address URLThanks to this post from Florian d’Erfurth I found a solution for this problem!
Add these lines in your .htaccess file in the root of your wordpress installation folder (in this case in the folder ‘blog’):
RewriteCond %{HTTP_HOST} =domain-b.com [NC] RewriteCond %{QUERY_STRING} (preview=true) RewriteRule ^$ domain-a.com/blog/?%{QUERY_STRING} [R=301,L]
And the generated draft preview url will be rewritten to the correct and working url!
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] problem with revisionsAnd thanks again! It works again ??
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] problem with revisionsOh duh… I missed that one, great it works now! ??
One thing I noticed though after today’s update to 1.0.1, my metaboxes are not in the main edit area anymore, the moved to the right side, even when I set all my connections to ‘context’ => ‘advanced’.
Any idea? Thanks againForum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] problem with revisionsI have the same issue. I turned off revisions for most of my custom post types, but for some I want to keep them.
When I make my connection types ‘reciprocal’ and edit one of the posts, I get a list of 100 posts with the text ‘inherit’ when clicking ‘view all’, while I only have 2 posts that can be connected, the rest are (old) revisions of those 2 posts.I tried using ‘post_status’ in your new ‘order_pages_by_title’ function but that doesn’t work:
function order_pages_by_title( $args, $context ) { if ( 'posts_to_pages' == $context->id ) { $args['orderby'] = 'title'; $args['order'] = 'ASC'; $args['post_status'] = 'publish'; } return $args; } add_filter( 'p2p_connectable_args', 'order_pages_by_title', 10, 2 );
I also disabled my plugin ‘Delete-Revision’ but that didn’t make a difference either.
How can I prevent revisions from showing up as available connection posts in the admin box without coding the admin box myself?Thanks for your help!
Forum: Fixing WordPress
In reply to: Preview draft not working with different Site Address URLI found this guide to rewrite the preview URL to a different (sub) domain, but I can’t seem to get it working for my setup:
How do you redirect URLs with a query string to another host?This is part of my .htaccess file in the root of domain-a:
RewriteCond %{HTTP_HOST} =domain-b.com [NC] RewriteCond %{QUERY_STRING} ^(p=([0-9]+)&preview=true) RewriteRule ^$ domain-a.com/?%[0-9]+ [R=301,L]
Any idea why this isn’t working?
Thanks!Forum: Fixing WordPress
In reply to: Preview draft not working with different Site Address URLSo am I really the only person with this problem?
I can’t imagine I’m the only one using this setup with 2 domains?Even with the new HTML5 soundcloud code using iframes the problem occurs.
Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?Brilliant ??
Thanks for all your help, appreciate it!Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?I’ve got number 2 figured out!
This works perfectly with domtab:<?php foreach ( $buckets as $type => $bucket ) { ?> <div class="tab"> <a name="<?php echo $type; ?>" id="<?php echo $type; ?>"></a> <?php foreach ( $bucket as $post ) { ?> <div class="post-block"> <?php the_post_thumbnail('thumbnail');?> <h3><a href="<?php echo get_post_meta($post->ID, 'participanturl', true); ?>" title="Open website" target="_blank"><?php the_title(); ?></a></h3> <?php echo p2p_get_meta($post->p2p_id, 'project', true); ?> </div> <?php } ?> </div> <?php } ?>
For question 1 I still don’t have a solution though…
Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?Oh by the way, I’m getting an error with the development version (0.9.5-alpha) when deleting an image from my media library:
Fatal error: Call to undefined method P2P_Storage::get() in /mydomain/wp-content/plugins/posts-to-posts/core/storage.php on line 80
Just to let you know
Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?Hi scribu,
Thanks, I tested it and it workes great! However I still have a few questions:
1) Is it possible to sort the output of the p2p_split_posts() array, the same way as the order of the entries in
'values' => array('value1', 'value2', 'value3', 'value4','value5')
?Right now, the only way to sort the array is by setting
'sortable' => '_order',
and re-arrange the connected posts in the order you want.
You can useasort($buckets, SORT_STRING);
offcourse, but I want it to have a particular order, or am I asking too much now?2) How can I use my own
p2p_list_posts( $bucket );
function if I don’t want a list of the posts, but my own structure?
p2p_list_posts( $bucket );
works great by the way, I get a list of the connected posts from that childtype. But if I start a new loop within the foreach like this:<?php if ( $connected->have_posts() ) : while ( $connected->have_posts() ) : $connected->the_post(); ?> <h3><a href="<?php echo get_post_meta($post->ID, 'participanturl', true); ?>" title="Open website" target="_blank"><?php the_title(); ?></a></h3> <?php endwhile; endif; ?>
I get all the connected posts, not sorted by childtype. How does this work exactly?
3) If I use a development version of your plugin, is it safe to update your plugin in the future without losing essential data?
Thanks for your time again!
Cheers, ToineForum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?Hi thanks for that,
Can’t seem to get this working,
echo $terms
does give me an array, but I’m not sure how I should do the foreach loop? I’m not really an expert on SQL queries I have to admit…$terms = $wpdb->get_col("SELECT DISTINCT meta_value FROM $wpdb->p2pmeta WHERE meta_key = 'childtype'" ); foreach($terms as $type): $connected = $participant_connection->get_connected( get_queried_object_id(), array( 'connected_meta' => array('childtype' => $type ) ) ); if ($connected->have_posts() ) : echo '<li><a href="#'.$type.'">'.$type.'</a></li>'; endif; endforeach;
I want to make an list item for every value (value1, value2 etc).
Any ideas on this?
Thanks!Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?And what about just getting the values regardless if it has a connected post or not?
Forum: Plugins
In reply to: [Plugin: Posts 2 Posts] Access values in connection field array?Hi scribu, thanks for your reply.
Yes I want to get back all the ‘childtype’ values that have at least one connection (I’m using it in combination with the domtab javascript). How do I achieve that exactly?
Thanks!Cool, thanks! Looking forward to the 0.9.4 version.