How do I modify the ‘more’ link in a feed

These are some tricks: /* Modify the read more link on the_excerpt() */ function et_excerpt_length($length) { return 220; } add_filter(‘excerpt_length’, ‘et_excerpt_length’); /* Add a link to the end of our excerpt contained in a div for styling purposes and to break to a new line on the page.*/ function et_excerpt_more($more) { global $post; return ‘<div … Read more

Twenty Seventeen Pages Loop

The page selection is set within the Customizer under Theme Options, which will only show when front page is set to static. The output happens within the function twentyseventeen_front_page_section in the theme file template-tags.php, where each panel is queried individually with get_post, so it’s not exactly a loop in the conventional sense. You can change … Read more

Combine two active_callbacks into one on theme customizer

Maybe I’m misreading your question, but combining these two conditions in one anonymous function doesn’t look that difficult: ‘active_callback’ => function() use ( $wp_customize ) { $condition1 == $wp_customize->get_setting( ‘twsa_show_schedule’ )->value(); $condition2 == $wp_customize->get_setting( ‘twsa_show_active’ )->value(); return ($condition1 && $condition2); } For really smart thinking on active callbacks, read Otto’s take on them.

Theme customizer – can’t add section/settings

Your use of add_control is incorrect. More specifically, you are not telling what type of control you want to add. Refer to the codex link to see which types can be generated automatically. I’ve given an example with a text field below. $wp_customize->add_control(‘cta_heading’, array( ‘label’ => __(‘CTA Heading’,’starter’), ‘section’ => ‘home_call_to_action_section’, ‘setting’=>’home_call_to_action_setting_section’, ‘type’=>’text’, )); Beware … Read more

How can i make multilevel menu in wordpress theme with bootstrap

Download Bootstrap nav walker file.Call this file to your functions.php. Then Put this code to dynamic your nav menu: <?php $args = array( ‘theme_location’ => ‘primary’, ‘menu’ => ‘Main’, ‘container’ => ‘false’, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ‘nav navbar-nav navbar-right’, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, … Read more

How to generate a hierarchical list of all pages and child-pages using a regular query?

You can use wp_list_pages() instead. Just pass your post type in if you’re trying to list something other than Page-pages: <ul> <?php wp_list_pages(array( ‘post_type’ => ‘yourposttype’, ‘title_li’ => ” ) ); ?> </ul> If you wanted to display this on all post types you could use <ul> <?php wp_list_pages(array( ‘post_type’ => $post->post_type, ‘title_li’ => ” … Read more