Lead Generation with Cookies in WordPress

Try using the jQuery Cookie plugin You can set a cookie to start with that could be called InfoSubmitted with value of ‘No’ and when they submit their info it changes to ‘Yes’ To set the cookie first make sure jQuery and the Cookie plugin are installed and then use this: jQuery.cookie(‘InfoSubmitted’, ‘No’); Once the … Read more

ajax page template

As it seems, it’s an easier way, using get_template_part and some php magic. What you do is get the page name from post_metadata filter the filename without the extension and add it to get_template_part. Of course all your data must conform a predefined variable (or just pass the id to the template) because you have … Read more

Showing sidebar-2 on custom template page

you can put this code in your functions add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘menu-1’ => __( ‘Head’ ) ) ); } and this code, in the place you want your second menu <?php wp_nav_menu( array( ‘theme_location’ => ‘menu-1’ ) ); ?> and than, you can control your new menu, through the … Read more

How to make page template with admin able to select NextGen Galleries to be part of the layout?

You can add galleries directly to a template by calling do_shortcode() to run the gallery shortcode. <?php echo do_shortcode(‘[nggallery id=”1″ template=”example”]’); ?> Edit: sorry, writing decaffeinated so short attention span 🙂 Add some custom fields to your product pages to let your client pick which gallery goes on that product. If you like, just use … Read more

Paginate WordPress Category Pages

paged is correct unless you’re using pretty permalinks, however, if you’re just trying to alter posts per page for categories, you should be using the pre_get_posts action, there’s no reason to use query_posts in the template: function wpa85791_category_posts_per_page( $query ) { if ( $query->is_category() && $query->is_main_query() ) $query->set( ‘posts_per_page’, 2 ); } add_action( ‘pre_get_posts’, ‘wpa85791_category_posts_per_page’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)