Forum Replies Created
-
AuthorPosts
-
November 3, 2016 at 1:38 PM in reply to: โ How to 'specify path to config file' in theme mode? #4417
Anh Tran
KeymasterHi,
I think there's a misunderstanding here. The extension provides UI for users to enter the config or specify the path to the config file (as instructed here). It doesn't work if you specify the path to the config file in your code.
Anh Tran
KeymasterHow to you want your pagination to be?
Anh Tran
KeymasterHi, currently, the plugin doesn't support showing the inputs in the frontend yet.
Anh Tran
KeymasterYes, that would work, too. I'm refactoring the code to make it better ๐
Anh Tran
KeymasterI have a solution for that, but it requires both the core plugin and the extension to update. I'm thinking about backward compatibility.
Anh Tran
KeymasterI've released new version which fixed this bug. Please download and enjoy ๐
Anh Tran
KeymasterAh, sorry, for image fields, the returned value is always an array. You need to change the code to:
$object_imgs = isset( $sector['rw_sector-object-image'] ) ? $sector['rw_sector-object-image'] : array(); if ( ! empty( $object_imgs ) ) { foreach ( $object_imgs as $object_img ) { echo '<div class="sector-object-img"> <div class="slider slider-for"> <img src="' . wp_get_attachment_image_url( $object_img, 'type=image_advanced&size=full&multiple=true' ) . '"> </div> </div>'; } }Anh Tran
KeymasterYou can use this code:
$metaBackgroundImage = rwmb_meta( 'socialityandydote_background_image' ); $metaBackgroundImage = empty( $metaBackgroundImage ) ? '' : reset( $metaBackgroundImage );This takes the first image from the returned array. Then you can use it without the foreach loop.
Anh Tran
KeymasterJust tried your code and 48 shows up as default value for me. Please note that it works only for the posts where the meta box hasn't been saved. You can check it with new posts.
Anh Tran
KeymasterDear armandmorin,
Please make sure the
{$prefix}hero_typefield is eq toheadline_subCheers!
Anh Tran
KeymasterThis is resolved on Github: https://github.com/rilwis/meta-box/issues/1001.
Anh Tran
KeymasterLooks like the regex pattern matches the wrong position. I will take a look at that.
Thanks for letting me know.
Anh Tran
KeymasterNo problem, here you are:
<?php $prefix = ''; $sectors = rwmb_meta( "{$prefix}sector" ); if ( ! empty( $sectors ) ) { foreach ( $sectors as $sector ) { $sector_heading = isset( $sector["{$prefix}sector-heading"] ) ? $sector["{$prefix}sector-heading"] : ''; echo $sector_heading; $sector_title = isset( $sector["{$prefix}sector-title"] ) ? $sector["{$prefix}sector-title"] : ''; echo $sector_title; $objects = isset( $sector["{$prefix}sector-object"] ) ? $sector["{$prefix}sector-object"] : array(); foreach ( $objects as $object ) { $object_img = isset( $object["{$prefix}sector-object-img"] ) ? $object["{$prefix}sector-object-img"] : ''; if ( $object_img ) { echo '<img src="' . wp_get_attachment_image_url( $object_img, 'size' ) . '">'; } $object_desc = isset( $object["{$prefix}sector-object-description"] ) ? $object["{$prefix}sector-object-description"] : ''; echo $object_desc; } } }Anh Tran
KeymasterAwesome features and links. I will make a note.
Anh Tran
KeymasterThat also works :). Remember to
strip_tagson the frontend when you retrieve the meta value ๐ -
AuthorPosts