How to make drop down post title
It’s better to use the wp_ajax_ action in an init action. In fact, wp_ajax_ action need to be accessable from anywhere. Use of the init action hook could make it work like it does. Hope it works
It’s better to use the wp_ajax_ action in an init action. In fact, wp_ajax_ action need to be accessable from anywhere. Use of the init action hook could make it work like it does. Hope it works
Here’s a stab at it. I’m not sure exactly what in your URL’s are taxonomies, or even what your taxonomies are, but basically you’d just have to loop through everything adding to the pages array with the arrays. You’d need to either define all your models in an array, or grab them from the database … Read more
is_tag() returns whether the query is for an existing tag archive page. This isn’t what you want to use. Instead, use get_query_var(). get_query_var( ‘tag’ ) will look at the tag query variable in the URL. For instance, if your URL is https://example.com/?tag=this&other=that then using: get_query_var( ‘tag’ ) will return this get_query_var( ‘other’ ) with return … Read more
It seems that you have forgotten to use <?php and ?> properly. Remember to open and close the php tag like the following: <?php if ( is_singular( array( ‘rivista’, ‘rivista-trimestrale’ ) ) ) {?> <script> jQuery(function($){ $(‘.parallax-window’).parallax({imageSrc: ‘<?php echo $ilgelo_options[‘ilgelo-parallax-image’][‘url’];?>’}); }); </script><?php } else { ?> <script> jQuery(function($){ $(‘.parallax-window’).parallax({imageSrc: ‘STYLESHEETPATH.”/img/header-rivista.jpg”‘}); }); </script><?php } ?>
In my opinion it is best to add an endpoint of the form mysite.com/pdf/<id> or something similar to your like. That way you avoiding attaching the attachments to posts/pages or create a page for each pdf file with is redundant imo for your needs. This is a very small and basic guide. You can modify … Read more
The keys for the array passed to register_nav_menus() should correspond with the ‘theme_location’ arguments in your calls to wp_nav_menu(). Since they do not, WordPress is unable to locate the appropriate menu and displays a default consisting of all top-level pages instead. Either change your ‘theme_location’ arguments to ‘menu-1’ and ‘menu-2’ or change the array keys … Read more
There are 2 ways you could do this. The first would be by creating a separate template for each of the pages you want. This is if you’re going to change a lot of different aspects of the page for each of the 7 pages. A page template will include the header, footer, and sidebar … Read more
You can use WP_Query instead the get_posts() function: $args = array( ‘numberposts’ => 20, ‘category_name’ => ‘sell-items’ ); $wp_query = new WP_Query($args); if ($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); echo ‘<li><a href=”‘.get_the_permalink().'”>’.get_the_title().'</a></li>’; endwhile; endif;
WordPress allows for customization of the default URL rewrite behavior (/slug/term) with a rewrite arguments array passed to the register_taxonomy() function. By defining values for the slug or hierarchical keys in this array, the default URL structure can be altered to suit your needs. It may also be altered such that unexpected results are returned. … Read more
You can try like this: if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ‘full’, array( ‘class’ => ‘responsive-class’ ) ); // show featured image }