Articles of customization

Separate header for static home page and posts page

My custom headers are located in the folder /parts/header/ and header selection is controlled using theme panel, so I tried write like this in my header.php but came out blank header in static front page, please advice. if (is_front_page() ) { get_header( ‘/parts/header/header-style-11.php’ ); } else { /* * loads the header template set in […]

Position a hard-coded menu item

I used a piece of code I found here in wordpress.stackexchange to add a custom link to my menu/nav. I adapted to my needs and it works great. The problem is it adds the link in the first position in my navigation list but I want it at the end after the other links. Does […]

CSS added through customizer neglects the need of a child theme?

Many developers know that if you change the style.css of a theme, and then the theme gets updated, your changes will be deleted. The traditional solution for that is creating a child theme inheriting everything from the parent theme, while changing the child theme’s CSS. But what about a case when I change the CSS […]

Hide a certain category name from Related Posts

I am trying to alter a plugin that has this code to display Related Categories names under the post: <?php if ( count( get_the_category() ) ) : ?> <span class=”cat-links”> <?php printf( __( ‘<span class=”%1$s”>See related Videos</span> %2$s’, ‘posts-in-page’ ), ‘entry-utility-prep entry-utility-prep-cat-links’, get_the_category_list( ‘, ‘ ) ); ?> </span> <?php endif; ?> Can someone please […]

searchform.php doesn't work properly

I made a searchform.php file to custom my search widget as I read, but when I use the search widget, it doesn’t make the searches well, it sarches in the page of the categorie i’m writing. Is there anything wrong with my code? <form role=”search” method=”get” id=”searchform” class=”searchform” action=”<?php esc_url( home_url( ‘/’ ) ); ?>”> […]

Wrong category nice name is displayed on archive page

on my blog www.gamerwithadegree.com I have a few categories with unique names. I have a small function in functions.php function gwad_cat_name(){ $categories = get_the_category(); if ( ! empty( $categories ) ) { echo esc_html( $categories[0]->category_nicename ); } }; This function gets the category nice name so I can then add it as a class like […]

Divi theme: change overlay color from default blue to back

On those pages I am unable to correct the the color of the button overlay. As you can see, they are black now but when you hover over, the color is changed to un ugly blue. I set the accent color to black in the Divi customization panel but I now want to correct this […]

Separate Content from gallery (custom post type)

i have a php file (single-model.php) who display in one div first the post content and than the gallery in thumbs. How can split the content from gallery and display the gallery in diferent div ..? the code is this: <div class=”col-xs-12″> <?php the_content(); $ids = get_post_meta( get_the_ID(), ‘scent_model_photos’, true ); $selected_images = ”; if( […]

Need help with pagination

I have a problem figuring out the pagination. Using the information i found in this WordPress Pagination Not Working – Always Showing First Pages Content thread, i’ve managed to set up pagination on my page. The code looks like this: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘posts_per_page’ => 10, ‘paged’ […]

Display a default image for custom-logo

I am switching my Genesis theme over to use WordPress’ 4.5 custom-logo function. It was simple to do: add_theme_support( ‘custom-logo’, array( ‘width’ => 861, ‘height’ => 130, ‘flex-width’ => true, ‘flex-height’ => true, ) ); However, I do not see a way in which to provide a default logo (which would be under theme/images/header.svg where […]