‘Business Ideas’,
‘singular_name’ => ‘Business Idea’,
‘add_new_item’ => ‘Add New Business Idea’,
‘edit_item’ => ‘Edit Business Idea’,
‘all_items’ => ‘All Business Ideas’,
‘search_items’ => ‘Search Business Ideas’,
);

register_post_type( ‘business_idea’, array(
‘labels’ => $labels,
‘public’ => true,
‘has_archive’ => true,
‘rewrite’ => array( ‘slug’ => ‘business-idea’ ),
‘menu_icon’ => ‘dashicons-lightbulb’,
‘supports’ => array( ‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’ ),
‘show_in_rest’ => true, // enables Gutenberg + REST (needed for block editor)
) );
}
add_action( ‘init’, ‘bif_register_post_type’ );

/* =========================================================
2. TAXONOMY: Business Category
========================================================= */
function bif_register_taxonomy() {
register_taxonomy( ‘business_category’, ‘business_idea’, array(
‘label’ => ‘Business Categories’,
‘hierarchical’ => true,
‘rewrite’ => array( ‘slug’ => ‘business-category’ ),
‘show_in_rest’ => true,
) );
}
add_action( ‘init’, ‘bif_register_taxonomy’ );

/* =========================================================
3. META BOX: Investment Amount + Full Business Plan
========================================================= */
function bif_add_meta_boxes() {
add_meta_box(
‘bif_details’,
‘Business Idea Details’,
‘bif_render_meta_box’,
‘business_idea’,
‘normal’,
‘high’
);
}
add_action( ‘add_meta_boxes’, ‘bif_add_meta_boxes’ );

function bif_render_meta_box( $post ) {
wp_nonce_field( ‘bif_save_meta’, ‘bif_meta_nonce’ );

$investment = get_post_meta( $post->ID, ‘_bif_investment’, true );
$full_plan = get_post_meta( $post->ID, ‘_bif_full_plan’, true );
?>


Tip: put the short public summary in the normal Content/Excerpt box above —
that part is always visible and is what Google will index. Only the box above (“Full Business Plan”) is gated.

‘business_category’, ‘hide_empty’ => false ) );

ob_start();
?>

‘business_idea’,
‘post_status’ => ‘publish’,
‘posts_per_page’ => 12,
);
if ( $search_term !== ” ) {
$args[‘s’] = $search_term;
}
if ( $category !== ” ) {
$args[‘tax_query’] = array( array(
‘taxonomy’ => ‘business_category’,
‘field’ => ‘slug’,
‘terms’ => $category,
) );
}

$query = new WP_Query( $args );

if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
$investment = get_post_meta( get_the_ID(), ‘_bif_investment’, true );
?>


💡

Investment:


View Full Idea →


No business ideas matched your search. Try a different keyword.

‘;
endif;
?>

ID, ‘_bif_investment’, true );
$full_plan = get_post_meta( $post->ID, ‘_bif_full_plan’, true );

$output = $content;

if ( $investment ) {
$output .= ‘

Investment needed: ‘ . esc_html( $investment ) . ‘

‘;
}

if ( is_user_logged_in() ) {
$output .= ‘

Full Business Plan

‘ . wp_kses_post( $full_plan ) . ‘

‘;
} else {
$current_url = esc_url( get_permalink( $post->ID ) );
$login_url = wp_login_url( $current_url );
$register_url = wp_registration_url();

$output .= ‘

🔒

Sign in to see the full business plan

Create a free account to unlock the step-by-step plan, licensing requirements, and profit breakdown for this business idea.

Sign In
Create Free Account

‘;
}

return $output;
}
add_filter( ‘the_content’, ‘bif_gate_content’ );

/* =========================================================
6. STYLES
========================================================= */
function bif_enqueue_styles() {
wp_register_style( ‘bif-style’, false );
wp_enqueue_style( ‘bif-style’ );
wp_add_inline_style( ‘bif-style’, bif_css() );
}
add_action( ‘wp_enqueue_scripts’, ‘bif_enqueue_styles’ );

function bif_css() {
return ”
.bif-wrap { font-family: -apple-system, ‘Segoe UI’, system-ui, sans-serif; color:#1a2b3c; }
.bif-search-form { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:28px; background:#f7f5f1; padding:16px; border-radius:10px; border:1px solid #e4dfd3; }
.bif-search-input { flex:1 1 240px; padding:12px 14px; border:1px solid #ccc; border-radius:6px; font-size:15px; }
.bif-search-select { padding:12px 14px; border:1px solid #ccc; border-radius:6px; font-size:15px; }
.bif-search-btn { padding:12px 22px; background:#0f2a3f; color:#fff; border:none; border-radius:6px; font-weight:600; cursor:pointer; }
.bif-search-btn:hover { background:#173a54; }
.bif-results { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap:22px; }
.bif-card { display:flex; flex-direction:column; text-decoration:none; color:inherit; border:1px solid #e6e2d8; border-radius:10px; overflow:hidden; background:#fff; transition: box-shadow .2s ease, transform .2s ease; }
.bif-card:hover { box-shadow: 0 8px 20px rgba(15,42,63,0.12); transform: translateY(-2px); }
.bif-card-img { aspect-ratio: 4/3; background:#f0ece2; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.bif-card-img img { width:100%; height:100%; object-fit:cover; }
.bif-card-img-placeholder { font-size:42px; }
.bif-card-body { padding:16px; display:flex; flex-direction:column; gap:6px; flex:1; }
.bif-card-title { font-size:17px; margin:0; color:#0f2a3f; }
.bif-card-excerpt { font-size:14px; color:#555; margin:0; flex:1; }
.bif-card-investment { font-size:13px; color:#a3721f; font-weight:600; margin:4px 0 0; }
.bif-card-cta { margin-top:10px; font-size:14px; font-weight:600; color:#c9922f; }
.bif-no-results { grid-column: 1/-1; color:#777; }

.bif-single-investment { background:#f7f5f1; padding:12px 16px; border-radius:8px; display:inline-block; }
.bif-gate { margin-top:30px; padding:28px; text-align:center; border:2px dashed #c9922f; border-radius:12px; background:#fffdf7; }
.bif-gate-seal { font-size:34px; margin-bottom:6px; }
.bif-gate h3 { margin:0 0 8px; color:#0f2a3f; }
.bif-gate p { color:#555; max-width:480px; margin:0 auto 18px; }
.bif-gate-btn { display:inline-block; padding:12px 24px; margin:0 6px; border-radius:6px; font-weight:600; text-decoration:none; background:#0f2a3f; color:#fff; }
.bif-gate-btn-outline { background:transparent; color:#0f2a3f; border:2px solid #0f2a3f; }
.bif-full-plan { margin-top:24px; }
“;
}