Forum Replies Created
-
AuthorPosts
-
sergeysemenov
Participant
sergeysemenov
ParticipantProblems with code paste
Here are images

sergeysemenov
ParticipantThanks for assistance, Anh Tran. But what if I need to retrieve metaboxes in a loop? Not from exact post but from the postroll? I've got a category displaying 19 posts in total. Some sort of a store. I want to click on every postblock in a roll and get quick view popup. What parameter do I have to put as $post_id?
January 20, 2017 at 1:41 PM in reply to: Display custom post custom fields everywhere in frontend #4871sergeysemenov
ParticipantI figured it out.
functions.php
$meta_boxes[] = array( 'title' => 'Related Products', 'post_types' => 'product', 'fields' => array( array( 'id' => "{$prefix}related_posts", 'type' => 'post', 'post_type' => 'product', 'clone' => true, ), ), );single-product.php
<?php $related_posts = rwmb_meta( 'rw_related_posts' ); foreach ( $related_posts as $related_post ) { // Setup the post object so we can use template tags. $post = get_post( $related_post ); setup_postdata( $post ); // Now you can use template tags. ?> "> "> </div> <? }?> <?php wp_reset_postdata(); ?>This works for me.
Thank you for your assistance, Anh Tran.
January 20, 2017 at 12:29 PM in reply to: Display custom post custom fields everywhere in frontend #4870sergeysemenov
ParticipantI managed to make it clonable. The problem was in my database which already has such values (I tested different variants before).
So, my Post Fields are created in admin, but when I insert second part of code to single-product.php, my page is blank and doesn't load.Tell me, what am I doing wrong?
I put this to my single-product.php
<?php add_filter( 'the_content', function ( $content ) { $related_posts = rwmb_meta( 'rw_related_products' ); if ( empty( $related_posts ) || ! is_array( $related_posts ) ) { return $content; } // Use output buffering to use the template tags easier. ob_start(); global $post; foreach ( $related_posts as $related_post ) { // Setup the post object so we can use template tags. $post = get_post( $related_post ); setup_postdata( $post ); // Now you can use template tags. ?> <a class="related-post" href="<?php the_permalink(); ?>"> <?php the_post_thumbnail( 'thumbnail' ); ?> <h2><?php the_title(); ?></h2> </a> <?php } $content .= ob_get_clean(); // Reset the post object. wp_reset_postdata(); return $content; } );January 20, 2017 at 11:31 AM in reply to: Display custom post custom fields everywhere in frontend #4869sergeysemenov
ParticipantI can't figure out how to make Post Field clonable. Metabox Builder doesn't have such option for Post Field. Neither manual integration in functions.php give no result. Where am I wrong?
My manual functions.php code is
$meta_boxes[] = array( 'title' => 'Related Products', 'post_types' => 'product', 'fields' => array( array( 'id' => "{$prefix}related_products", 'type' => 'post', 'post_type' => 'product', 'clone' => true, ), ), );sergeysemenov
ParticipantGreat! Works! Thank you!
One more question on POST FIELD. I wrote this question to our previous discussion and didn't create additional topic.
The aim is to make clonable dropdown select in my custom post template admin area to manually select ‘related’ custom posts and retrieve thumbnail and title of these posts in frontend. I managed to create such clonable dropdown field, so I can select my custom posts. But I can’t figure out how to display these selected posts thumbs and titles in frontend. Please help!
January 20, 2017 at 2:55 AM in reply to: Display custom post custom fields everywhere in frontend #4861sergeysemenov
ParticipantThank you, Anh Tran. I caught the idea. It works.
One more question about 'Post' Field.
The aim is to make clonable dropdown select in my custom post template admin area to manually select 'related' custom posts and retrieve thumbnail and title of these posts in frontend. I managed to create such clonable dropdown field, so I can select my custom posts. But I can't figure out how to display these selected posts thumbs and titles in frontend. Please help!sergeysemenov
ParticipantDear Tan,
It works. Thanks for assistance.
Best regards,
Sergey
January 17, 2017 at 7:20 PM in reply to: ✅Display custom terms image_advanced on page frontend #4829sergeysemenov
ParticipantYes. All fields are created. Image_advanced and text field for each term of taxonomy. I need to output these pre-made fields for each term on homepage. Then, when I create a new term in the same taxonomy and fill my pre-made fields, they must output automatically.
sergeysemenov
ParticipantThe way I did it before buying MB builder and MB Tabs. YOAST checked it ok.
$meta_boxes[] = array( 'title' => 'Расположение', 'post_types' => array( 'page' ), 'exclude' => array( 'user_id' => array( 5 ) ), 'fields' => array( array( 'name' => __( 'Основной текст слайда', 'rw_' ), 'desc' => __( 'Основной текст слайда', 'rw_' ), 'id' => "{$prefix}location-text", 'type' => 'wysiwyg', 'cols' => 20, 'rows' => 3, 'add_to_wpseo_analysis' => true, ), array( 'name' => __( 'Крупное фоновое изображение', 'rw_' ), 'id' => "{$prefix}location-bg1", 'type' => 'image_advanced', 'max_file_uploads' => 1, ), array( 'name' => __( 'Мобильное фоновое изображение', 'rw_' ), 'id' => "{$prefix}location-bg1-mob", 'type' => 'image_advanced', 'max_file_uploads' => 1, ), ) );sergeysemenov
ParticipantHi Anh Tran. I mean that before using MB Builder I used regular manual integration of custom fields with Metabox. When I added 'add_to_wpseo_analysis' => true to wysiwyg fields my yoast seo block checked it ok. For now, creating metaboxes in MB Builder -> MB Tabs -> wysiwyg for custom post, Yoast seo block doesn't recognize text in custom wysiwyg in my tabs.
Metabox created in builder. General Tab.
https://drive.google.com/file/d/0Byg2KbQbI04ATVBxVTBJVzJHQ2c/view?usp=sharingMetabox created in builder. Advanced Tab.
https://drive.google.com/file/d/0Byg2KbQbI04Ab29qdHVEbjdpTWs/view?usp=sharingTabs in custom post
https://drive.google.com/file/d/0Byg2KbQbI04ARldDWDZGWTl6UTQ/view?usp=sharingYoast block not recognize tabs wysiwyg content
https://drive.google.com/file/d/0Byg2KbQbI04AX1p3blRlOFNfSms/view?usp=sharingStandard wordpress wysiwyg on top of the same post
https://drive.google.com/file/d/0Byg2KbQbI04AanNsMUl3TnJsOUE/view?usp=sharingYoast block recognize standard wysiwyg content
https://drive.google.com/file/d/0Byg2KbQbI04AMWNqUFpEVnVEOHM/view?usp=sharingsergeysemenov
ParticipantP.S. I registered only Metabox extensions plugins through functions.php. All other plugins including Yoast Seo are activated normally through wordpress admin panel activation.
sergeysemenov
ParticipantHi Anh Tran.
Before buying bundle, I used some of your extensions and configured it manually in functions.php with 'add_to_wpseo_analysis' => true. Since I have really nice MB Builder I supposed it must register all my extensions with MB for Yoast automatically. But it doesn't.
Here is my code in functions.php.require get_template_directory() . '/metabox/mb-settings-page/mb-settings-page.php'; // Path to the extension's main file require get_template_directory() . '/metabox/meta-box-builder/meta-box-builder.php'; // Path to the extension's main file require get_template_directory() . '/metabox/meta-box-conditional-logic/meta-box-conditional-logic.php'; require get_template_directory() . '/metabox/meta-box-tabs/meta-box-tabs.php'; require get_template_directory() . '/metabox/mb-term-meta/mb-term-meta.php'; require get_template_directory() . '/metabox/meta-box-group/meta-box-group.php'; require get_template_directory() . '/metabox/meta-box-template/meta-box-template.php'; require get_template_directory() . '/metabox/meta-box-include-exclude/meta-box-include-exclude.php'; require get_template_directory() . '/metabox/meta-box-tooltip/meta-box-tooltip.php'; require get_template_directory() . '/metabox/meta-box-columns/meta-box-columns.php'; require get_template_directory() . '/metabox/meta-box-show-hide/meta-box-show-hide.php'; require get_template_directory() . '/metabox/meta-box-yoast-seo/mb-yoast-seo.php'; // Path to the extension's main filesergeysemenov
ParticipantI mean support with MetaBox YOAST seo. Do fields in tabs rate in search?
-
AuthorPosts