get_term_link doesn’t work

I do not know how ACF works or how its data is stored, but in general, I would just use usort() to sort the returned array of terms via the ACF value of cognome_nome. Note that array_push is a bit expensive to use, so try to avoid that 😉 As I stated in comments, your … Read more

CSS for Table Rows and Columns

After much frustration I realised that the issue is the fact that you need ultimately to specify what you do with the cell in the nth row, hence the correct code is: table td:nth-child(1), table tr:nth-child(1) td { font-weight: bold; } Putting this up as the answer as there are a lot of sources that … Read more

Problem retrieving custom field for a custom post type

The solution is simple: in the first loop, you are setting the $amazon_link like this: $amazon_link = get_field(‘amazon_link’, $image[‘ID’]); but in the second loop, you are setting a $link, like this: $link = get_field(‘amazon_link’, $image[‘ID’]); but you’re still trying to echo $amazon_link variable later on, which has never been setup in the second loop, so … Read more

Javascript code for Category

Write this in your theme’s functions.php file function category_enqueue_script() { $cat_education_id = ‘xx’; // category id for “education” $cat_dog_id = ‘yy’; // category id for “dog” if ( is_category() && ( is_category( $cat_education_id ) || is_category( $cat_dog_id ) ) ) { wp_enqueue_script( ‘my-js’, ‘filename.js’, false ); } } add_action( ‘wp_enqueue_scripts’, ‘category_enqueue_script’ );

Trying to Understand Shortcodes.

I would recommend using a shortcode, because its easy to use and at the same time efficient. Below I have attached the code, how you can put your code into a shortcode. the add_shortcode function is what you use when you want to create a shortcode. To use it, you simply need to write [render_slider_shortcode] … Read more