How can I add search box in single.php?

Try this and change the classes if needed. <div id=”navbar” class=”navbar”> <nav id=”site-navigation” class=”navigation main-navigation” role=”navigation”> <button class=”menu-toggle”><?php _e( ‘Menu’, ‘twentythirteen’ ); ?></button> <a class=”screen-reader-text skip-link” href=”#content” title=”<?php esc_attr_e( ‘Skip to content’, ‘twentythirteen’ ); ?>”><?php _e( ‘Skip to content’, ‘twentythirteen’ ); ?></a> <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’, ‘menu_id’ => ‘primary-menu’ ) … Read more

Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis

I have this post and the response from David Chu to thank for enlightening me. There is nothing patently ‘wrong’ with the way that I implemented this. The reason that it doesn’t work is because of the fact that I have both the Genesis Simple Sidebars plugin and the Genesis Woocommerce Connect plugin installed. Both … Read more

Passing a Variable to a Function Hooked to Genesis Entry Content

If you are going to be setting the notice dynamically, what I would do is just pull in the notice in the callback function. But if you can’t do that for whatever reason, you can do a little wizardry like so: if( $notice ) { remove_action( ‘genesis_entry_content’, ‘genesis_do_post_content’ ); add_action ( ‘genesis_entry_content’, function() use ($notice) … Read more

Remove genesis_404 hook from genesis_loop [closed]

I found a solution for this problem: For some reason, the add_action() and remove_action() had to be contained inside another action, genesis_meta: add_action( ‘genesis_meta’, function () { if (is_404()) { remove_action( ‘genesis_loop’, ‘genesis_404’ ); add_action( ‘genesis_loop’, ‘genesis_customizations_404’ ); } }, 11);

Genesis Framework: How to exclude a specific author from archive custom loop

You can do it with the pre_get_posts hook. In WP_Query there is an author parameter : https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters pre_get_posts hook : https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts function wpse_288986_remove_post_from_author($query) { // We have to check if we are in front and if the query is the main query if(!is_admin() && $query->is_main_query() && is_archive()) { $query->set(‘author’, -2); // Where 2 is your … Read more

display text on the same line

Note that the_author_meta() doesn’t return the meta value, but echoes it. That’s why the name is suddenly outside the <p> element. Use get_the_author_meta() if you need to return (and do something with) the field, rather than just display it. I’d highly recommend you to change your use usage of __() too, because that is not … Read more

Query to get child pages of current page and display it in action hook

I was making a beginner’s mistake. I was not defining the global variable post. I publish my complete code for the community. May be useful for something like me. <?php add_action( ‘genesis_after_entry’, ‘capitulos_curso’ ); function capitulos_curso(){ global $post; $args = array( ‘post_type’ => ‘curso’, ‘posts_per_page’ => -1, ‘post_parent’ => $post->ID, ‘order’ => ‘ASC’, ‘orderby’ => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)