Use PHP code in Menu Admin Section

Allan, thanks for clarifying the question. You can’t add PHP in the wp-admin menu manager. Instead, here is a way to keep the menu dynamic and managed in wp-admin, while still allowing you to add your PHP at the end: <?php $args = array( ‘menu’ => ‘your-menu-name’, ‘container’ => ”, ‘items_wrap’ => ‘%3$s’ ); ?> … Read more

making a search.php query

You are missing the search parameter in your arguments. The code below, when added to the array in $the_query, should pass along the query string variable from a search: ‘s’ => $s Documentation is available here: https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter

Custom Post Type with Custom Taxonomy in Bootstrap 4 Accordion

Here the solution: <?php $post_type=”paradas”; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies( (object) array( ‘post_type’ => $post_type ) ); foreach( $taxonomies as $taxonomy ) : // Gets every “category” (term) in this taxonomy to get the respective posts $terms = get_terms( $taxonomy, array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ … Read more

Bootstrap carousel – Using shortcode inside enclosing shortcode

Here is my solution: function getProductCarousel($atts) { $productIds = explode(‘,’,$atts[‘product_ids’]); ?> <div class=”col-center m-auto”> <div id=”myCarousel” class=”carousel slide” data-ride=”carousel” data-interval=”0″> <!– Carousel indicators –> <ol class=”carousel-indicators”> <?php $slide = 0; ?> <?php foreach($productIds as $index => $productId) { ?> <?php if ($index % 3 == 0) { ?> <li data-target=”#myCarousel” data-slide-to=”<?= $slide++; ?>” <?= $index … Read more

creating different style CTA button in the menu

why don’t you add a class that is the permalink for example? ie $output .= “<li class=”nav-item $active_class $dropdown_class ” . implode(” “, $item->classes) . “”>”; (this line is strange first because it’s going to output “nav item $active_class $dropdown_class”…is that what you want?) but all the same it COULD be $output .= “<li class=”nav-item … Read more