I want to change a given menu with submenus into a dropdown menu.
Actually it opens a new row below the main menu. You can see in the given screenshot here.
I have searched in the code for the shown css class nm-shop-sub-categories and found this function. The class nm-shop-sub-categories is at the end of the function.
/*
* Product category menu: Output
*/
if ( ! function_exists( 'nm_category_menu_output' ) ) {
function nm_category_menu_output( $is_category, $current_cat_id, $hide_empty ) {
global $wp_query, $nm_theme_options;
$page_id = wc_get_page_id( 'shop' );
$page_url = get_permalink( $page_id );
$hide_sub = true;
$current_top_cat_id = null;
$all_categories_class = '';
// Is this a category page?
if ( $is_category ) {
$hide_sub = false;
// Get current category's top-parent id
$current_cat_parents = get_ancestors( $current_cat_id, 'product_cat' );
if ( ! empty( $current_cat_parents ) ) {
$current_top_cat_id = end( $current_cat_parents ); // Get last item from array
}
// Get current category's direct children
$current_cat_direct_children = get_terms( 'product_cat',
array(
'fields' => 'ids',
'parent' => $current_cat_id,
'hierarchical' => true,
'hide_empty' => $hide_empty
)
);
$category_has_children = ( empty( $current_cat_direct_children ) ) ? false : true;
} else {
// No current category, set "All" as current (if not product tag archive or search)
if ( ! is_product_tag() && ! isset( $_REQUEST['s'] ) ) {
$all_categories_class = ' class="current-cat"';
}
}
$output_cat = '<li' . $all_categories_class . '>' . esc_html__( 'All', 'nm-framework' ) . '</li>';
$output_sub_cat = '';
$output_current_sub_cat = '';
// Categories order
$orderby = 'slug';
$order = 'asc';
if ( isset( $nm_theme_options['shop_categories_orderby'] ) ) {
$orderby = $nm_theme_options['shop_categories_orderby'];
$order = $nm_theme_options['shop_categories_order'];
}
$categories = get_categories( array(
'type' => 'post',
'orderby' => $orderby, // Note: 'name' sorts by product category "menu/sort order"
'order' => $order,
'hide_empty' => $hide_empty,
'hierarchical' => 1,
'taxonomy' => 'product_cat'
) );
// Categories menu divider
$categories_menu_divider = apply_filters( 'nm_shop_categories_divider', '<span>⁄</span>' );
foreach( $categories as $category ) {
// Is this a sub-category?
if ( $category->parent != '0' ) {
// Should sub-categories be included?
if ( $hide_sub ) {
continue; // Skip to next loop item
} else {
if (
$category->parent == $current_cat_id || // Include current sub-category's children
! $category_has_children && $category->parent == $wp_query->queried_object->parent // Include categories with the same parent (if current sub-category doesn't have children)
) {
$output_sub_cat .= nm_category_menu_create_list( $category, $current_cat_id, $categories_menu_divider );
} else if (
$category->term_id == $current_cat_id // Include current sub-category (save in a separate variable so it can be appended to the start of the category list)
) {
$output_current_sub_cat = nm_category_menu_create_list( $category, $current_cat_id, $categories_menu_divider );
}
}
} else {
$output_cat .= nm_category_menu_create_list( $category, $current_cat_id, $categories_menu_divider, $current_top_cat_id );
}
}
if ( strlen( $output_sub_cat ) > 0 ) {
$output_sub_cat = '<ul class="nm-shop-sub-categories">' . $output_current_sub_cat . $output_sub_cat . '</ul>';
}
$output = $output_cat . $output_sub_cat;
echo $output;
}
}
Is it possible to rewrite the function to generate a dropdown menu instead of the shown menu?
As you can see in the screenshot the css class
<ul class="nm-shop-sub-categories">
<li>item_1</li>
<li>item_2</li>
</ul>
is not inside the parent listing. But I want it to be like this structure:
<ul class="nm-shop-categories">
<li>parent_item_1</li>
<ul class="nm-shop-sub-categories">
<li>sub_item_1</li>
<li>sub_item_2</li>
</ul>
<li>parent_item_2</li>
</ul>
Since in my code is no classic html I don't know how to change that via php. Any ideas?
Or is there no need to change the structure and I can use css to make change this menu into a clssic dropdown menu?
Update: I've made the changes mentioned by Norman. But it didn't solved the problem. The subcategories are still seperate from the parent ul elements.
In addition to the fist block of code I've found a second one relating to subcategories. Maybe this would be of any help?
/*
* Product category menu: Output sub-categories
*/
if ( ! function_exists( 'nm_sub_category_menu_output' ) ) {
function nm_sub_category_menu_output( $current_cat_id, $hide_empty ) {
global $wp_query, $nm_theme_options;
// Categories menu divider
$categories_menu_divider = apply_filters( 'nm_shop_categories_divider', '<span>⁄</span>' );
$output_sub_categories = '';
// Categories order
$orderby = 'slug';
$order = 'asc';
if ( isset( $nm_theme_options['shop_categories_orderby'] ) ) {
$orderby = $nm_theme_options['shop_categories_orderby'];
$order = $nm_theme_options['shop_categories_order'];
}
$sub_categories = get_categories( array(
'type' => 'post',
'parent' => $current_cat_id,
'orderby' => $orderby, // Note: 'name' sorts by product category "menu/sort order"
'order' => $order,
'hide_empty' => $hide_empty,
'hierarchical' => 1,
'taxonomy' => 'product_cat'
) );
$has_sub_categories = ( empty( $sub_categories ) ) ? false : true;
// Is there any sub-categories available
if ( $has_sub_categories ) {
//$current_cat_name = __( 'All', 'nm-framework' );
$current_cat_name = apply_filters( 'nm_shop_parent_category_title', $wp_query->queried_object->name );
foreach( $sub_categories as $sub_category ) {
$output_sub_categories .= nm_category_menu_create_list( $sub_category, $current_cat_id, $categories_menu_divider );
}
} else {
$current_cat_name = $wp_query->queried_object->name;
}
// "Back" link
$output_back_link = '';
if ( $nm_theme_options['shop_categories_back_link'] ) {
$parent_cat_id = $wp_query->queried_object->parent;
if ( $parent_cat_id ) {
// Back to parent-category link
$parent_cat_url = get_term_link( (int) $parent_cat_id, 'product_cat' );
$output_back_link = nm_sub_category_menu_back_link( $parent_cat_url, $categories_menu_divider );
} else if ( $nm_theme_options['shop_categories_back_link'] == '1st' ) {
// 1st sub-level - Back to top-level (main shop page) link
$shop_page_id = wc_get_page_id( 'shop' );
$shop_url = get_permalink( $shop_page_id );
$output_back_link = nm_sub_category_menu_back_link( $shop_url, $categories_menu_divider, ' 1st-level' );
}
}
// Current category link
$current_cat_url = get_term_link( (int) $current_cat_id, 'product_cat' );
$output_current_cat = '<li class="current-cat">' . esc_html( $current_cat_name ) . '</li>';
echo $output_back_link . $output_current_cat . $output_sub_categories;
}
}
Structure you required is not the best to manage with CSS
As per the code assumption it seems like you need below structure as the resultant.
<ul class="nm-shop-categories">
<li>parent_item_1
<ul class="nm-shop-sub-categories">
<li>sub_item_1</li>
<li>sub_item_2</li>
</ul>
</li>
<li>parent_item_2</li>
</ul>
To achieve the above structure, i would suggest you to change the line this
$output_cat = '<li' . $all_categories_class . '>' . esc_html__( 'All', 'nm-framework' ) . '</li>';
To
$output_cat = '<li' . $all_categories_class . '>';
$output_cat .= '' . esc_html__( 'All', 'nm-framework' ) . '';
And End of output
$output = $output_cat . $output_sub_cat;
To
$output = $output_cat . $output_sub_cat .'</li>';
Related
Hi I am trying to display the child term of the current post category page.
However I can figure out what am missing here. Thanks
<?php
$current_tax = get_query_var( 'category' );
$current_term = get_queried_object()->term_id;
$child_terms = get_terms( array('category' => $current_tax,
'child_of' => $current_term,
'orderby' => 'name' ));
if ( ! empty( $child_terms ) && ! is_wp_error( $child_terms ) ) {
echo '<div class="post-index__cate">';
foreach( $child_terms as $child ) {
printf( '<a class="category-name" href="%s">', get_term_link( $child, $child->taxonomy ));
echo $child->name. '</a>';
}
echo '</div>';
}
?>
In your code the taxonomy should be “category”, so your arguments for get_terms() should have “taxonomy” => “category”. $current_tax is irrelevant in this code then.
I have a function that should rather display a link to the first or last record which is in the same category as the pulling one, but by clicking on the "forward" or "back" button, it then switches between two records, although there are three in the category , or, in the category where one record, throws on the records of another category. And I need him, after there are no entries left, from the last one he can switch to the first record from the SAME CATEGORY and from the FIRST record to the LAST as there is a back button with the SAME CATEGORY
function da_the_adjacent_post_link( $course = '' ){
global $post;
$course = ( $course == 'prev' ) ? true : false;
$order = ( $course ) ? 'DESC' : 'ASC';
$class = ( $course ) ? 'prev' : 'next';
$link = get_adjacent_post_link( '%link', '%title', true, '', $course );
if ( ! $link ){
$term = get_the_terms( $post->ID, 'category' );
$term = $term[0];
$article = get_posts([
'post_type' => portfolio,
'post_per_page' => 1,
'exclude' => $post->ID,
'category' => $term->term_id,
'order' => $order
]);
if ( empty($article) )
return false;
else
$article = $article[0];
$link = sprintf( '<a href="' . get_the_permalink($article->ID) . '"> ');
}
echo $link;
}
if( get_adjacent_post(true,'',true) ) {
previous_post_link('%link', '<div class="icon-button">');
} else {
da_the_adjacent_post_link( $course = '' ); ?>
};
if( get_adjacent_post(true, '', false)){
next_post_link('%link', ' <div class="icon-button">')
} else {
da_the_adjacent_post_link( $course = '' ); ?>
};
I use custom theme with woocommerce. My main page displays products by categories and they are wrapped in the standard woocommerce block <div class="woocommerce columns-4">. I need to remove it. In woocommerce folder i found just a single reference about this block in woocommerce/includes/class-wc-shortcodes.php
return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
I tried to change it to return '';, but still have the same wrapper.
Is there any option to remove this block?
Function with <div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>' is below.
public static function product_categories( $atts ) { public static function product_categories( $atts ) {
global $woocommerce_loop;
if ( isset( $atts['number'] ) ) {
$atts['limit'] = $atts['number'];
}
$atts = shortcode_atts( array(
'limit' => '-1',
'orderby' => 'name',
'order' => 'ASC',
'columns' => '4',
'hide_empty' => 1,
'parent' => '',
'ids' => '',
), $atts, 'product_categories' );
$ids = array_filter( array_map( 'trim', explode( ',', $atts['ids'] ) ) );
$hide_empty = ( true === $atts['hide_empty'] || 'true' === $atts['hide_empty'] || 1 === $atts['hide_empty'] || '1' === $atts['hide_empty'] ) ? 1 : 0;
// Get terms and workaround WP bug with parents/pad counts.
$args = array(
'orderby' => $atts['orderby'],
'order' => $atts['order'],
'hide_empty' => $hide_empty,
'include' => $ids,
'pad_counts' => true,
'child_of' => $atts['parent'],
);
$product_categories = get_terms( 'product_cat', $args );
if ( '' !== $atts['parent'] ) {
$product_categories = wp_list_filter( $product_categories, array(
'parent' => $atts['parent'],
) );
}
if ( $hide_empty ) {
foreach ( $product_categories as $key => $category ) {
if ( 0 === $category->count ) {
unset( $product_categories[ $key ] );
}
}
}
$atts['limit'] = '-1' === $atts['limit'] ? null : intval( $atts['limit'] );
if ( $atts['limit'] ) {
$product_categories = array_slice( $product_categories, 0, $atts['limit'] );
}
$columns = absint( $atts['columns'] );
$woocommerce_loop['columns'] = $columns;
ob_start();
if ( $product_categories ) {
woocommerce_product_loop_start();
foreach ( $product_categories as $category ) {
wc_get_template( 'content-product_cat.php', array(
'category' => $category,
) );
}
woocommerce_product_loop_end();
}
woocommerce_reset_loop();
return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
}
if you removed woocommerce from the class many of your site's woocommerce functionality may crash.
its not recommended if you want to add custom-class just use jquery.addclass
$('#yourid').addClass('class-to-be-added');
$('#yourid').removeClass('class-to-be-removed');
You can use following jQuery code:
<script>
jQuery( document ).ready(function() {
var proUL = jQuery( ".products" );
if ( proUL.parent().is( "div" ) ) {
jQuery( ".products" ).unwrap();
}
});
</script>
I am writing a small wordpress plugin that would read a list of WooCommerce product categories and then create a menu or update an existing menu as per the category names and links. The update is triggered by clicking a button in a POSTed form. So far the plugin creates the menu with all categories and sub categories as parent items in the menu, I want it to put sub categories into sub menus but it fails.
Here is the code that helps me achieve this:
public function update_menu(){
$children = array();
$mains = array();
$no_menu = false;
$args = array(
'taxonomy' => 'product_cat',
'orderby' => 'name'
);
$all_categories = get_categories( $args );
$menu_name = get_option('woo_cats_menu_menu_name');
$locations = get_nav_menu_locations();
$menus = get_registered_nav_menus();
foreach ( $menus as $name => $description ){
if ( $menu_name == $name )
$menu_description = $description;
}
if ( !empty ( $all_categories ) ){
//public variables defined in the class
$this->added = 0;
$this->notadded = 0;
$this->notinmenu = 0;
$this->inmenu = 0;
$menu = wp_get_nav_menu_object($locations[$menu_name]);
$menu_items = wp_get_nav_menu_items($menu->term_id); //convert to array
$menu_items = $this->toArray( $menu_items );
echo "<br><br>Menus printouts.. Converted to array<br />";
print_r( $menu_items );
foreach ($all_categories as $cat) {
if (!empty( $locations ) && isset($locations[$menu_name]) ) {
//if the category is not in the menu, then we add it//
//if ($cat->name != $title && get_term_link($cat->slug, 'product_cat') != $url && )
if ( false == $this->in_multiarray($cat->name, $menu_items) ){//!$this->in_array_md( $cat->name, $menu_items)
if ( $cat->parent == 0 || $cat->parent == "" || $cat->category_parent == 0 ){ //if is a main category
$mains[] = array(
'cat_id' => $cat->term_id,
'name' => $cat->name,
'cat_name' => $cat->cat_name,
'slug' => $cat->slug,
'category_parent' => $cat->category_parent,
'link' => get_term_link($cat->slug, 'product_cat')
);
}else{ // if child_of is > 0
$children[] = array(
'cat_id' => $cat->term_id,
'name' => $cat->name,
'cat_name' => $cat->cat_name,
'slug' => $cat->slug,
'category_parent' => $cat->category_parent,
'child_of' => $cat->category_parent,
'link' => get_term_link($cat->slug, 'product_cat')
);
}
$this->notinmenu++;
}else{
$this->inmenu++;
}
}else{
$no_menu = true;
}
}
}
/*echo "<br />Second printout<br />";
print_r( $menu_items );*/
if ( $no_menu == false && !empty( $mains ) ){
echo "<br /><strong>Adding main categories</strong><br />";
/*print_r( $mains );
echo "<br />End: Mains<br />";*/
if ( count( $mains ) > 1 ){
//if we have multiple categories
foreach ( $mains as $main ){
//print_r ( $main );
if ( !$this->in_multiarray($main['name'], $menu_items) ){ //if is a main category
echo "Category not in menu...., ";
echo "Adding to menu::> '".$main['name']."' = '".$main['link'] . "'<br />";/**/
$menu_id = wp_update_nav_menu_item($menu->term_id, 0, array(
'menu-item-title' => esc_attr( $main['name'] ),
'menu-item-url' => esc_attr( $main['link'] ),
'menu-item-status' => 'publish')
);
if ( !is_wp_error($menu_id) ) $this->added++;
else $this->notadded++;
}else{
$this->notadded++;
}
}
}elseif ( count ( $mains ) == 0 ){
//if we have one category, call it mains
$main = $mains;
if ( !$this->in_multiarray($main['name'], $menu_items) ){ //if is a sub category
echo "Category not in menu...., ";
echo "Adding to menu::> '".$main['name']."' = '".$main['link'] . "'<br />";/**/
$menu_id = wp_update_nav_menu_item($menu->term_id, 0, array(
'menu-item-title' => esc_attr( $main['name'] ),
'menu-item-url' => esc_attr( $main['link'] ),
'menu-item-status' => 'publish')
);
if ( !is_wp_error($menu_id) ) $this->added++;
else $this->notadded++;
}else{
$this->notadded++;
}
}else{
$this->notadded++;
}
}
if ( $no_menu == false && !empty( $children ) ){
echo "<br /><strong>Adding child menu items.</strong><br />";
if ( count ( $children ) > 1 ) {
foreach ( $children as $child ){
if ( !$this->in_multiarray($child['name'], $menu_items) ){//!$this->in_array_md( $child['name'], $menu_items, false)
echo "-- Adding Sub Category:: ID: " . $child['cat_id'].", parent: ". $child['category_parent'].", Name: ".$child['name'].", -> \"".$child['link']."\"<br />";/**/
$parent_id = esc_attr( $this->get_parent_id( $mains, $children, esc_attr( $child['cat_id'] ) ) );
$parent_name = $this->get_parent_name( $mains, $parent_id );
$menu_item = $this->get_menu_item( $parent_name, $child['link'] );
//print_r ( $menu_item );
echo "Real Parent: $parent_name, {$menu_item->ID}<br />";
$menu_id = wp_update_nav_menu_item($menu->term_id, 0, array(
'menu-item-title' => esc_attr( $child['name'] ),
'menu-item-parent-id' => $menu_item->ID,
'menu-item-url' => esc_attr( $child['link'] ),
'menu-item-status' => 'publish')
);
//echo $sub_category->name ;
//update post_parent
if ( !is_wp_error($menu_id) ) {
wp_update_post(array('ID'=>$menu_id,'post_parent'=>$menu_item->ID));
update_post_meta( $menu_id, '_menu_item_menu_item_parent', $menu_item->ID );
$this->added++;
}
else $this->notadded++;
}else{
$this->notadded++;
}
}
}elseif ( count ( $children ) == 1 ) {
if ( false == $this->in_multiarray($child['name'], $menu_items) ){//!$this->in_array_md( $child['name'], $menu_items, false)
echo "-- Adding Sub Category:: ".$child['name'].", -> \"".$child['link']."\"<br />";/**/
//$parent_id = esc_attr( $this->get_parent_id( $mains, $children, esc_attr( $child['cat_id'] ) ) );
$parent_id = esc_attr( $this->get_parent_id( $mains, $children, esc_attr( $child['cat_id'] ) ) );
$parent_name = $this->get_parent_name( $mains, $parent_id );
$menu_item = $this->get_menu_item( $parent_name, $child['link'] );
echo "Real Parent: $parent_name, {$menu_item->ID}<br />";
$menu_id = wp_update_nav_menu_item($menu->term_id, 0, array(
'menu-item-title' => esc_attr( $child['name'] ),
'menu-item-parent-id' => $menu_item->ID,
'menu-item-url' => esc_attr( $child['link'] ),
'menu-item-status' => 'publish')
);
//echo $sub_category->name ;
//update post_parent
if ( !is_wp_error($menu_id) ) {
wp_update_post(array('ID'=>$menu_id,'post_parent'=>$menu_item->ID));
update_post_meta( $menu_id, '_menu_item_menu_item_parent', $menu_item->ID );
$this->added++;
}
else $this->notadded++;
}else{
$this->notadded++;
}
}else{
$this->notadded++;
}
}
/*echo "<br>Mains<br>";
print_r( $mains );
echo "<br>Children<br>";
print_r( $children );*/
//if we have updated a menu
if ( $no_menu == true ){
echo '<div class="alert alert-warning settings-error notice update-nag"><p><strong>Sorry but nothing to do!</strong> Please make sure you created an empty menu and assign it to the menu <em><strong>"'.$menu_description.'"</strong></em> selected on the right. Go to <em><strong>"Appearance > Menus"</strong></em>, select the menu you selected on this page and check the checkbox next to <em><strong>"'.$menu_description.'"</strong></em>.</p></div>';
}else{
echo '<div class="updated alert alert-success"><p><strong>The menu has been updated!</strong> ' . $this->notinmenu . ' Items were added to the menu, '. $this->inmenu .' Items were already in the menu.</p></div>';
}
}
public function get_parent_id( $parents, $children, $kid ){
foreach ( $parents as $parent ){
foreach ( $children as $child ){
if ( $parent['cat_id'] == $child['child_of'] && $child['cat_id'] == $kid ){
return $parent['cat_id'];
}
}
}
return 0;
}
public function get_parent_name( $parents, $parent_id ){
foreach ( $parents as $parent ){
if ( $parent['cat_id'] == $parent_id ){
return $parent['name'];
}
}
return null;
}
public function get_menu_item($menu_item_name, $link){
global $wpdb;
$table = $wpdb->prefix.'posts';
$post = $wpdb->get_row("SELECT * FROM {$table} WHERE post_title='{$menu_item_name}' AND post_type='nav_menu_item'"); // url='{$link}'");
return $post;
}
public function in_multiarray($elem, $array){
//checks if $elem is in multidimensional $array
}
In my wordpress theme I am creating some custom fields like
cp_street, cp_city, cp_mobile_no, cp_company_name
and much more. Which is displayed in single_ad_listing.php page, and code is
cp_get_ad_details( $post->ID, $cat_id );
and theme-function.php page code is
// display all the custom fields on the single ad page, by default they are placed in the list area
if ( ! function_exists('cp_get_ad_details') ) {
function cp_get_ad_details( $post_id, $category_id, $location = 'list' ) {
global $wpdb;
// see if there's a custom form first based on category id.
$form_id = cp_get_form_id( $category_id );
$post = get_post( $post_id );
if ( ! $post )
return;
// if there's no form id it must mean the default form is being used
if ( ! $form_id ) {
// get all the custom field labels so we can match the field_name up against the post_meta keys
$sql = "SELECT field_label, field_name, field_type FROM $wpdb->cp_ad_fields";
} else {
// now we should have the formid so show the form layout based on the category selected
$sql = $wpdb->prepare( "SELECT f.field_label, f.field_name, f.field_type, m.field_pos FROM $wpdb->cp_ad_fields f "
. "INNER JOIN $wpdb->cp_ad_meta m ON f.field_id = m.field_id WHERE m.form_id = %s ORDER BY m.field_pos ASC", $form_id );
}
$results = $wpdb->get_results( $sql );
if ( ! $results ) {
_e( 'No ad details found.', APP_TD );
return;
}
// allows to hook before ad details
cp_action_before_ad_details( $results, $post, $location );
foreach ( $results as $result ) {
// external plugins can modify or disable field
$result = apply_filters( 'cp_ad_details_field', $result, $post, $location );
if ( ! $result )
continue;
$disallow_fields = array( 'cp_price', 'cp_currency' );
if ( in_array( $result->field_name, $disallow_fields ) )
continue;
$post_meta_val = get_post_meta( $post->ID, $result->field_name, true );
if ( empty( $post_meta_val ) )
continue;
if ( $location == 'list' ) {
if ( $result->field_type == 'text area' )
continue;
if ( $result->field_type == 'checkbox' ) {
$post_meta_val = get_post_meta( $post->ID, $result->field_name, false );
$post_meta_val = implode( ", ", $post_meta_val );
}
$args = array( 'value' => $post_meta_val, 'label' => $result->field_label, 'id' => $result->field_name, 'class' => '' );
$args = apply_filters( 'cp_ad_details_' . $result->field_name, $args, $result, $post, $location );
if ( $args )
echo '<li id="' . $args['id'] . '" class="' . $args['class'] . '"><span>' . esc_html( translate( $args['label'], APP_TD ) ) . ':</span> ' . appthemes_make_clickable( $args['value'] ) . '</li>';
} elseif ( $location == 'content' ) {
if ( $result->field_type != 'text area' )
continue;
$args = array( 'value' => $post_meta_val, 'label' => $result->field_label, 'id' => $result->field_name, 'class' => 'custom-text-area dotted' );
$args = apply_filters( 'cp_ad_details_' . $result->field_name, $args, $result, $post, $location );
if ( $args )
echo '<div id="' . $args['id'] . '" class="' . $args['class'] . '"><h3>' . esc_html( translate( $args['label'], APP_TD ) ) . '</h3> ' . appthemes_make_clickable( $args['value'] ) . '</div>';
}
}
All fields display serially, but I want to like address cp_street, cp_city top of page and mobile no.( cp_mobile_no) right side of page and rest of fields display same place.
Please help me...
In this tutorial we will look at how the Advanced Custom Fields plugin can be used to create a professional home page .
i hope this like use full.. here simple code..