-
Search Results
-
Topic: New Custom Post Types
I tried putting this in my child theme’s functions.php, and it’s not throwing any errors, but it breaks the media library. Any ideas of how I could create a custom post type?
<!-- new post type = Proud Bulldog Business --> <?php /* * Creating a function to create our CPT */ function custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Bulldog Businesses', 'Post Type General Name', 'twentytwenty' ), 'singular_name' => _x( 'Bulldog Business', 'Post Type Singular Name', 'twentytwenty' ), 'menu_name' => __( 'Bulldog Businesses', 'twentytwenty' ), 'parent_item_colon' => __( 'Parent Business', 'twentytwenty' ), 'all_items' => __( 'All Businesses', 'twentytwenty' ), 'view_item' => __( 'View Business', 'twentytwenty' ), 'add_new_item' => __( 'Add New Business', 'twentytwenty' ), 'add_new' => __( 'Add New', 'twentytwenty' ), 'edit_item' => __( 'Edit Business', 'twentytwenty' ), 'update_item' => __( 'Update Business', 'twentytwenty' ), 'search_items' => __( 'Search Business', 'twentytwenty' ), 'not_found' => __( 'Not Found', 'twentytwenty' ), 'not_found_in_trash' => __( 'Not found in Trash', 'twentytwenty' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'businesses', 'twentytwenty' ), 'description' => __( 'Proud Bulldog Businesses', 'twentytwenty' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'genres' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'show_in_rest' => true, ); // Registering your Custom Post Type register_post_type( 'businesses', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'custom_post_type', 0 ); ?>I’m trying to build an archive of posts build using Advanced Custom Fields that is searchable by at least two of those fields. For this example, the posts are for individual businesses and I want to be able to search the archive by industry and by location. Is there a way to do that or should I build something from scratch?
Hi guys from the Staff, I’m losing hope, but I think it’s the fault of my lack of experience, I need to add the shadow to a special title so that it is more visible, I use the css modification present in the advanced section of the special title but not it works, I insert in the id field I insert (#shadow) and in the personal css field (.shadow .av-special-heading-tag {text-shadow: 0px 0px 5px black! important;}) the round brackets I used to delimit the fields I wrote on this post.
I hope you can give me a solution thanks and good luck.I have the same contact form from Enfold editor on a few subsites, but only on one site it does not work. No “message sent”, no e-mail sent, nothing. And only this site has the 403 error (PageSpeed). In the past few years it worked properly.
All plugins were disabled one by one and the form was tested after disabling each one (except for Advanced Custom Fields PRO because after turning it off, the page does not load at all).
Only this site has the AMP version. The link has been removed from the Advanced Custom Field to check if it is the reason. But it does not change anything.
Several “WordPress people” tried without success to find the cause.
Hi. I have added, with Advanced custom fields, 2 fields in the posts. Also, I would like to put the categories.
I have used this widget

And this is the result

I would like it to stay like this

I go to wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/postslider.php and above this line >> $output .= $thumbnail ? “{$thumbnail}” : “”; I put this
$taxonomies = get_object_taxonomies(get_post_type($the_id));
$output .= “<div class=’categ’>”.$taxonomies.”</div>”;But the result that you return to me is

What have I put wrong?
In the case of the country and the image of the flag, above this line >> $output .= “<h3 class=’slide-entry-title entry-title’ $markup>“.$title.”</h3>”; I have put
$pais = get_field (“País”, $entry->ID);
$output .= “<div class=’pais’>”.$pais.”</div>”;
$bandera = get_field (“bandera”, $entry->ID);
$image = get_field(‘Bandera’);
$size = ‘full’; // (thumbnail, medium, large, full or custom size)
if( $image ) {
echo wp_get_attachment_image( $image, $size );};
$output .= “<div class=’bandera’>”.$Bandera.”</div>”;And this is the result

The ARRAY is of the country and the image is not visible. How should I put it on to make it look good? The country data are from a multi-selection field and the flag data from an image field
Can you help me find the solution?


