Search
 
SCRIPT & CODE EXAMPLE
 

PHP

acf add options page to custom post type

if( function_exists('acf_add_options_page') ) {
    
    acf_add_options_sub_page(array(
        'page_title'     => 'Offers Page Content',
        'menu_title'    => 'offers-page-content',
        'parent_slug'    => 'edit.php?post_type=offers',
    ));

}
Comment

Display acf fields in custome post type

<?php
     $args=array(
     'post_type' => 'book',
     'post_status' => 'publish',
     'posts_per_page' => 12,
     'caller_get_posts'=> 1,
     'orderby'=> 'date',
     'order' => 'DESC'
     );
     $my_query = null;
     $my_query = new WP_Query($args);
     if( $my_query->have_posts() ) {
     echo '';
     $i = 0;
     while ($my_query->have_posts()) : $my_query->the_post();
     if($i % 6 == 0) { ?>
<div class="row">    
<?php
}
?>

<img src="<?php the_field('cover_image'); ?>" /><br />
<?php the_field('author_name'); ?><br />
<?php the_title(); ?><br />

</div>

<?php    
if($i % 6 == 0) { ?> 

<?php
}

$i++;
endwhile;
 } 
wp_reset_query();
?>
Comment

Display acf fields in custome post type

<?php
     $args=array(
     'post_type' => 'book',
     'post_status' => 'publish',
     'posts_per_page' => 12,
     'caller_get_posts'=> 1,
     'orderby'=> 'date',
     'order' => 'DESC'
     );
     $my_query = null;
     $my_query = new WP_Query($args);
     if( $my_query->have_posts() ) {
     echo '';
     $i = 0;
     while ($my_query->have_posts()) : $my_query->the_post();
     if($i % 6 == 0) { ?>
<div class="row">    
<?php
}
?>

<img src="<?php the_field('cover_image'); ?>" /><br />
<?php the_field('author_name'); ?><br />
<?php the_title(); ?><br />

</div>

<?php    
if($i % 6 == 0) { ?> 

<?php
}

$i++;
endwhile;
 } 
wp_reset_query();
?>
Comment

Display acf fields in custome post type

<?php
     $args=array(
     'post_type' => 'book',
     'post_status' => 'publish',
     'posts_per_page' => 12,
     'caller_get_posts'=> 1,
     'orderby'=> 'date',
     'order' => 'DESC'
     );
     $my_query = null;
     $my_query = new WP_Query($args);
     if( $my_query->have_posts() ) {
     echo '';
     $i = 0;
     while ($my_query->have_posts()) : $my_query->the_post();
     if($i % 6 == 0) { ?>
<div class="row">    
<?php
}
?>

<img src="<?php the_field('cover_image'); ?>" /><br />
<?php the_field('author_name'); ?><br />
<?php the_title(); ?><br />

</div>

<?php    
if($i % 6 == 0) { ?> 

<?php
}

$i++;
endwhile;
 } 
wp_reset_query();
?>
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel - Send mail using mail class 
Php :: wp-config for production 
Php :: inplode php 
Php :: PHP join() Function 
Php :: attach function in laravel 
Php :: Diferencia entre dias PHP - Con date_diff() 
Php :: laravel notification 
Php :: Calling itself a static function in php 
Php :: use php artisan command through controller 
Php :: laravel eloquent get one column value 
Php :: laravel manually authenticate user 
Php :: php check jwt token expired 
Php :: mysql_real_escape_string 
Php :: laravel basic login 
Php :: php convert string to array 
Php :: install a package only composer dont update 
Php :: php api connection 
Php :: delay queue laravel 
Php :: php get all days between two dates 
Php :: php photo upload 
Php :: wp-config.php 
Php :: laravel seeder with relationships 
Php :: Function create_function() is deprecated in 
Php :: show phpinfo just modules 
Php :: theme mod disalow wp 
Php :: create config value file in php 
Php :: install spatie for role and permissions 
Php :: array random php 
Php :: pest check url status 
Php :: what is php artisan 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =