Home › Forums › General Issues › ACF usage with Genesis Framework › Reply To: ACF usage with Genesis Framework
Hello,
I added the following code in page.php file but adding anything in that file breaks all my pages.
// Remove Skip Links
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 );
// Dequeue Skip Links Script
add_action( 'wp_enqueue_scripts', 'genesis_sample_dequeue_skip_links' );
function genesis_sample_dequeue_skip_links() {
wp_dequeue_script( 'skip-links' );
}
// Force full width content layout
// Remove site header elements
// remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
// remove_action( 'genesis_header', 'genesis_do_header' );
// remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
// Remove navigation
// remove_theme_support( 'genesis-menus' );
// Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
// Remove footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
// Remove site footer elements
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
// Remove page title
// Remove site inner wrap
add_filter( 'genesis_structural_wrap-site-inner', '__return_empty_string' );
// Remove edit link
add_filter ( 'genesis_edit_post_link' , '__return_false' );
// Load landing page styles
add_action( 'wp_enqueue_scripts', 'landing_do_tables_styles' );
function landing_do_tables_styles() {
wp_enqueue_style( 'tables', CHILD_URL . '/tables.css', array(), PARENT_THEME_VERSION );
}
//======================================================================
// BEGIN ACF CONTENT
//======================================================================
add_action( ‘genesis_entry_content’, ‘ACF_content’ );
function ACF_content() {
if( have_rows('content-block') ): ?>
<div class="any-class-name">
<?php // loop through rows (parent repeater)
while( have_rows('content-block') ): the_row(); ?>
<div style="background-color:<?php get_sub_field('background_color'); ?>">
<p><?php get_sub_field('content'); ?></p>
</div>
endwhile;
else :
// no rows found
endif;
</div>
?>
<?php }
//======================================================================
// END ACF CONTENT
//======================================================================
I really appreciate your time and effort but unfortunately, I wasn’t able to make it work. Are there any changes that needs to be added in functions.php file because we have another website which uses ACF and the code is added in functions file.
Regards,
Ali
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.