Different image and background color depending on page type

I’ve used WordPress Conditional Tags to add a unique class or id to the containing div of the different page types. This could work well to change the background image/color for different types. Also, WordPress automatically adds a body class to the <body> tag for each page, so that could possibly be hooked into for … Read more

Show results for multiple page-types

You should use ‘meta_query’ instead it is a array of arrays $product_pages_args = array( ‘meta_query’ => array( array( ‘key’ => ‘_wp_page_template’, ‘value’ => array(‘page_library_html_content.php’,page_library_css_content.php’) , ‘compare’ => ‘IN’ ), ) )

Get null from POST

Please show Your html form code. Also i think you have an error in $wpdb->insert statment. Should be: $wpdb->insert(wp_ow_odczyty, array($data));

Trying to see if page is category or single and displaying title with appropriate heading tag

aha…white screen of death. I don’t know how I missed it. Your if statement lacks parenthesis. Try this: public function title() { if ( is_category() ) { echo ‘<h2 class=”post_title”>’; } else { echo ‘<h1 class=”post_title”>’; }; echo ‘<a href=”‘; the_permalink(); echo ‘” data-disqus-identifier=”‘; the_ID(); echo ‘”>’; the_title(); if ( is_category() ) { echo ‘</a></h2>’; … Read more

Jquery and Sticky

First, please use wp_enqueue_script() to add JavaScript to your WordPress pages. Also note that jQuery is loaded by default in WordPress; there’s no need for you to do it. From that same page: The jQuery library included with WordPress is set to the noConflict() mode (see wp-includes/js/jquery/jquery.js). This is to prevent compatibility problems with other … Read more

Post Thumbnail on Single (if elseif else)

I tried to refactor the code in a preferred way, that’s all. Logically, it seems to work. What I did is: I preferred WP_Query() for such custom query, because experienced WordPress enthusiasts like it that way (We can learn more) I changed the hard-coding into WordPress way to get the theme directory, using get_template_directory_uri() And … Read more

Is there a way to randomize and connect a background and header image?

Here’s some sample code you can use for the header or background. This uses the genesis header hook which you can change to a theme specific hook or WordPress hook. add_action(‘genesis_header’, ‘conditional_header_image’); function conditional_header_image() { if ( is_tag(‘your-tag’)) { echo ‘<div class=”home-header”><img src=”http://example.com/path/to/image.png” alt=”home header image” /></div>’; elseif(is_page() ) echo ‘<div class=”page-header”><img src=”http://example.com/path/to/image.png” alt=”page header … Read more

Dynamic Gallery

You can use Advanced Custom Fields plugin – paid, to to that: http://www.advancedcustomfields.com/add-ons/gallery-field/ Plase what a video. Also on lightbox you need this Jquery plugin: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ Create a custom post type with name gallery. Then create a page-gallery.php and put this code: : <?php $args=array( ‘post_type’ => ‘gallery’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 12, ‘paged’ … Read more