argeee
Forum Replies Created
-
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Loop over post 2 post loopYep, it worked. I used the following:
$temp_prod_ID= get_queried_object_id();
and then substituted get_the_ID() as follows:$connected = new WP_Query( array( 'post_type' => 'ups', 'connected_from' => $temp_prod_ID, 'nopaging' => true, 'suppress_filters' => false ) );PS.
How you give better support than for most paying plugins is something that is beyond me…Anyway, I made a small contribution for all the help that you’ve been giving me.
Thanks again,
Mauro
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Loop over post 2 post loopHi Scribu,
I don’t thinks that I explained my question correctly. The first loop is not a p2p loop. Meaning its a wp loop. The second one is a p2p loop. My problem is that if I do a WP_Query on before the p2p, p2p outputs nothing, whereas if I do it after everything is OK. Please see a summarized version of my code:$wp_query = new WP_Query(array( 'post_type' => 'client', 'client_type' => 'Distributor')); while ($wp_query->have_posts()) : $wp_query->the_post(); echo '<h2>' . the_title() . '</h2>'; //just testing if outputs endwhile; wp_reset_postdata(); $connected = new WP_Query( array( 'post_type' => 'ups', 'connected_from' => get_the_ID(), 'nopaging' => true, 'suppress_filters' => false ) ); ?> <div id="products_wrapper"> <h3><?php _e('you may also be interested in...','eq_power') ?></h3> <?php // if ($connected->have_posts()) : while( $connected->have_posts() ) : $connected->the_post(); ?> <div class="products_item_wrapper"> <?php echo '<h2>' . the_title() . '</h2>'; //just testing if outputs?> </div> <!-- end products_item_wrapper --> <?php endwhile; wp_reset_postdata();?> <!-- end products_wrapper -->thanks,
Mauro
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Reciprocal only working one wayThis is a great little tool if you need to share a screenshot or record a short video of your actions on the screen.
I’m not related to them, but it has proven to be very useful for debugging over time.
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Single from and array of to(s)Hi Scribu,
What about the syntax in my first post? Is that possible?As for making sense, I think it has.
For example, you might have product-a related to product-b and product-c. Whereas product-b might be related to product-a, but also product-x. In other words, they are not reciprocal.
This means that you might be interested in setting an order…thanks
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] Single from and array of to(s)Sorry,
One additional thing…the series type is related to itself:$my_connection_type = p2p_register_connection_type( array( 'from' => 'series', 'to' => array('series','post', 'page' ) 'sortable' => '_order' ) );thanks
Forum: Plugins
In reply to: [Breadcrumb NavXT] Multi-language supportHi guarrodesign,
As mtekk mentioned, you have to wait until the new version 4.0 comes out.
The alternative is to go to Masino Sinagas blog and implement his solution – I have not tested it.hope it helps,
mauro
Forum: Plugins
In reply to: [Breadcrumb NavXT] Duplicate since upgradeHi,
Check the next post for what might be a partial solution to your problem.Mauro
Forum: Fixing WordPress
In reply to: Moving content only to a testing domainHi,
Anybody found a solution to this?
I am getting the same error. In the past I would just click on the export button and wordpress would create the xml file. However, now when I click on it I get a blank page with “Could not find the file to download”.
I think that you are supposed get the an option page to choose the dates etc. All I am getting is a page with option buttons regarding page, posts, etc. After I click on the ‘download on the export file’ I get the error page.Thanks
Forum: Plugins
In reply to: [Theme My Login] [Plugin: Theme My Login] Use different form for registrationThanks Jeff. Worked like a charm.
PS Sorry for taking so long to reply
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedWhat can I say…
I really don’t know where you find the time..Thanks for the plugin and now for the tut.
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedBTW. Here is the working sample in case it is of some use for future users.
<?php $connected = new WP_Query( array( 'post_type' => 'product', 'connected_from' => get_the_ID(), 'nopaging' => true, 'suppress_filters' => false ) ); ?> <div id="products_wrapper"> <h3>you may also be interested in...</h3> <?php if ($connected->have_posts()) : while( $connected->have_posts() ) : $connected->the_post(); $connection_type = p2p_get_meta( $post->p2p_id, 'connection_type', true ); $characteristic_01 = get_post_meta( get_the_ID(), 'characteristic', true ); ?> <div class="products_item_wrapper"> <ul> <li class="prod_pic"> <!--check if post has an image otherwise output generic eq logo--> <?php if (get_the_post_thumbnail($connection_type->ID, 'thumbnail')):?> <a href=" <?php echo get_permalink(get_the_ID()); ?> "> <?php echo get_the_post_thumbnail($connection_type->ID, 'thumbnail'); ?> </a> <?php else:?> <a href="<?php echo get_permalink($accesory->ID); ?>"> <img src="<?php echo $upload_dir['baseurl'].'/2010/11/product_blank_background-150x150.png'; ?>" alt="<?php echo get_permalink($accesory->ID); ?>" width='150' height='150' /> </a> <?php endif;?> </li> <li><?php echo $characteristic_01; ?></li> <li class="title"> <a href="<?php echo get_permalink($accesory->ID); ?>"> <?php the_title();?> </a> </li> <li> <ul class="prod_description"> <li> <?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,25); ?> </li> </ul> </li> </ul> </div> <!-- end products_item_wrapper --> <?php endwhile; wp_reset_postdata();?> <?php else:?> <li> <div class="products_item_wrapper"> <ul class="prod_description"> <li><?php echo "there seem to be no associated products"; ?></li> </ul> </div> <!-- end products_item_wrapper --> </li> <?php endif;?> </div> <!-- end products_wrapper -->Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedThanks for the answer.I did include your suggestion but for some reason it did not work. that is why I did not include it.
I am using version 0.7 however – and the reason behind this confusion – is that even after reading the documentation of the various versions and reading most of the posts for the plugin, it is VERY hard to make out what functionality carries from one version to the next as everything is very peacemeal.
Don’t take me wrong, I appreciate very much all the effort that you have put into helping me. But I think that you would waste less time if there was a complete document with two or three scenarios on how to use the pluging.
Thanks again and sorry for the oversight.
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedHi Scribu,
the code has not changed much. all that I have modified as I explained in my last post is the:
<li><?php echo p2p_get_meta( $post->p2p_id, 'characteristc', true ); ?></li>to try to access the p2p_id properties. On that same single page I can access them with the:
echo get_post_meta( $post->ID, 'characteristic',true);Just in case you can see something that has escaped me here is the modified code:
<?php /* Template Name: related_products_template */ ?> <?php $connected = new WP_Query( array( 'post_type' => 'product', 'connected_from' => get_the_ID(), 'nopaging' => true, 'suppress_filters' => false ) ); ?> <div id="products_wrapper"> <h3>you may also be interested in...</h3> <?php if ($connected->have_posts()) : while( $connected->have_posts() ) : $connected->the_post(); $connection_type = p2p_get_meta( $post->p2p_id, 'connection_type', true ); ?> <div class="products_item_wrapper"> <ul> <li class="prod_pic"> <!--check if post has an image otherwise output generic eq logo--> <?php if (get_the_post_thumbnail($connection_type->ID, 'thumbnail')):?> <a href=" <?php echo get_permalink(get_the_ID()); ?> "> <?php echo get_the_post_thumbnail($connection_type->ID, 'thumbnail'); ?> </a> <?php else:?> <a href="<?php echo get_permalink($accesory->ID); ?>"> <img src="<?php echo $upload_dir['baseurl'].'/2010/11/product_blank_background-150x150.png'; ?>" alt="<?php echo get_permalink($accesory->ID); ?>" width='150' height='150' /> </a> <?php endif;?> </li> <li><?php echo p2p_get_meta( $post->p2p_id, 'characteristc', true ); ?></li> <li class="title"> <a href="<?php echo get_permalink($accesory->ID); ?>"> <?php the_title();?> </a> </li> <li> <ul class="prod_description"> <li> <?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,25); ?> </li> </ul> </li> </ul> </div> <!-- end products_item_wrapper --> <?php endwhile; wp_reset_postdata();?> <?php else:?> <li> <div class="products_item_wrapper"> <ul class="prod_description"> <li><?php echo "there seem to be no associated products"; ?></li> </ul> </div> <!-- end products_item_wrapper --> </li> <?php endif;?> </div> <!-- end products_wrapper -->Thanks again
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedSorry, any updates on how I could solve this issue?
thanks in advance.
Forum: Plugins
In reply to: [Posts 2 Posts] [Plugin: Posts 2 Posts] duplicates using p2p_get_connectedI changed it but did not update. ‘characteristic’ is the actual custom field.
The way I was trying to access it – following the instructions you have for ver. 0.5 is:
<li><?php echo p2p_get_meta( $post->p2p_id, 'characteristic', true ); ?></li>.
While on the single page I echo this same ‘characteristic’ as follows:
echo get_post_meta( $post->ID, 'characteristic',true);I can see why you are saying that I am confusing the connection and the post id, but I did realize that and changed it. However, even trying to access the custom field as above is outputs nothing.
Thanks