I have a main menu of 3 items, and for each of these I have a different secondary menu. I would like to show the related secondary menu on each page.
I currently used is_page with slug. I will need to add wpml, so each page will have more slugs. I would like to ask if you can suggest me a cleaner and more maintainable solution.
This is what I did at the moment:
I’ve created a plugin for my child theme, in which custom functions are stored. Additionally, within the plugin, I’m also enqueueing stylesheets and .js which control the output of two templates, for a custom post type named workshops. (The only place on the site where the enqueued styles and .js are needed.)
I’m currently working on designing my custom WooCommerce theme and wondering how I could change the HTML output of loop_product_title in single product page and in archive pages.
I have a plugin that uses this filter to add some content to a Custom Post Type.
I try to attribute a specific background-color to each post if one of categories of post corresponding to one category.
My function works but is restricted to display only one post in result.
If I delete this function, all post are displayed.
I have a specific CSS-file for my search results, so the search.php template. I want a PHP if-condition to determine if the current template is the search.php template, so that I can load that CSS-file with wp_enqueue
. The condition should work in the functions.php file.
How can I check if the current page is wp-login.php
or wp-signup.php
?
I am looking for a way to test if a post is a custom post type. For example, in, say, the sidebar I can put in code like this:
I’d like to have a custom field interface show up only when a certain template is assigned to a particular WordPress page.