Child Theme files – what is needed?

Yes you will need to enqueue parent theme styles into child theme. Adding style.css in child theme will not automatically add parent theme’s styles too. You can enqueue parent theme’s styles like this. Create a new functions.php in child theme and paste this. function enqueue_child_theme_styles() { wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array(‘parent-style’) ); … Read more

Commenter should see only his comments in wordpress

What you need to do to achieve this is to provide the second parameter of wp_list_comments(), which would be $comments and is described like this: (array) (optional) Array obtained by get_comments query. Default: The default return of get_comments. Which actually makes it clear what you need to do, which would be utilizing get_comments(). Below a … Read more

changing behaviour of get_search_form

you don’t need to add another function to get the search form. If you want to change the look of the search form or add another items you’ll have to add the searchform.php to your theme. It could look like this: <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( “https://wordpress.stackexchange.com/” ); ?>”> <input type=”search” class=”search-field” placeholder=”Suchen … Read more

Toggle User Roles with button

As it happens, I have something very similar on one of my sites to to allow Administrators update some custom user meta. Basically, you need to add an additional column and then populate it with a link to do what you want. When you click the link some jQuery fires of an AJAX request to … Read more

Understanding and altering the structure of posted images

Lets start with your first code. If you add texts, captions etc. a shortcode will be generated: The function img_caption_shortcode() in wp-content/media.php is responsible to execute the shortcode. But this shortcode is only produced, when you use captions. Otherwise, it will be simply inserted the <a>– and <img>-Tag. who decides, what gets inserted? There is … Read more

Conditional read more adjustment

It was simpler than I thought. This has solved it. <?php add_filter(‘the_content_more_link’, ‘modify_read_more_link’); function modify_read_more_link() { return ‘<a class=”more-link” href=”‘ . get_permalink() . ‘”>Your Read More Link Text</a>’; } the_content(“Read More”); ?>