Nav menu custom html:

WordPress themes can be set up in many different ways, which is both a blessing (you can do things however you like) and a curse (there’s not always a single file you need to look at to make a particular change). You’re on the right track, looking into the theme. What you’ll need to do … Read more

Php echo into tag

If you want to wrap an HTML tag around the user display names, you can simply close and open the PHP tags: <div class=”author_sidebar”> <?php if ( is_singular( ‘post’ ) ) { ?> <div class=”foo”><?php echo get_avatar( get_the_author_meta( ‘user_email’ ), 75 ); ?></div> <div class=”bar”><?php echo get_the_author_meta( ‘display_name’ ); ?> <?php } ?> </div>

Issues with the excerpt (wordcount/HTML/images)

Answer on my own question (without using a plugin and choosing a middle way) for what we want to achieve. Because the template has also a code starting with: if ( has_post_thumbnail() && ( $post->post_type == ‘post’ ) ) we have taken that part of code away. (we won’t used it in postings/pages, therefore) Following … Read more

Query WordPress Database and Post HTML Table

$html= “<table>”; foreach($result as $r){ $html .=”<tr>”; $html .=”<td>”.$r->post_title.”</td>”; $html .=”<td><a href=””.get_the_permalink($r->ID)””>”.$r->post_title.”</a></td>”; $html .=”</tr>”; } $html .=”</table>”; echo $html; To avoid the depreacated usage of PHP code snippets you can wrap it in a shortcode and use anywhere in a page/post content editor function Stack_308511_post_grid( $atts ) { $atts = shortcode_atts( array( ‘limit’ => 10, … Read more

How do I modify the with wp_nav_menu()

Welcome to WPSO. You need to modify the Walker_Nav_Menu Class. That class is responsible for rendering the HTML menu output in first place. The theme you are using is calling the WordPress menu class, which will then output your menu. As alexwc_ mentioned the alt attribute is for images, not for anchor tags. So in … Read more

where is images/image.jpg?

The plugin is search for an ‘images’ folder inside the current working directory. For example if you are in /blogs/, a file looking for images/image.jpg is actually looking for /blogs/images/image.jpg. This can obviously get very messy when re-writing URLs with stuff like /2010/03/blog-title so actually put an image in the specific location is impossible, you … Read more

Forcing absolute src links in the RSS feed

Relative URLs are considered bad practice in WP, because of such issues and that they can be much more complex to migrate. Basic approach to fixing this (not counting changing to absolute URLs everywhere) would be to filter the_content, while checking for is_feed(), and adjust links on the fly.