Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Oddly, I found that the Chrome extension “Murdoch Block” was responsible for this error (in my case). It can simply be disabled in Chrome extension settings.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    >All other ‘short codes’, like [link_name] only work within the template of the plugin. They should be inserted only in the field next to “How to display the links?”

    Ah yes, that was it, sorry. Some other plugins expect you to paste the generated code directly into the post, which I followed out of habit.

    Confirmed, it clashed with the latest version of Contact Form 7’s date tag.

    Which is unfortunate, because CF7’s date tag has a whole bunch of problems. It uses HTML5, and the jquery fallback is very limited (can’t format date, set language, etc) and breaks on Android’s browser.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    I couldn’t solve this properly. If I directly insert js in the footer like this –

    $( "input[type=date]" ).datepicker();

    – then it works (but of course Chrome etc then get two datepickers). So it seems to be something about wpcf7SupportHtml5.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    oops, 3rd one is on line 366.

    I have something similar – I’m using html entities such as  – that’s ampersand hash xe000 semicolon – when I write that into the html editor, switch to Visual and back, they’re converted to the encoded character. (Which is odd, since that’s unicode’s Private Use Area, shouldn’t have any symbols in it.)

    The rendered webpage works as expected, so I don’t actually have a problem. But the usability of the html editor would be impaired for someone that needed to see the html entities.

    Ahhhh… a missing closing bracket at the end of every is_page line.

    It should be like this:

    <?php function rhl_select_slide_header() {
    	 if ( function_exists( 'meteor_slideshow' ) ) {
    		if ( is_page( 'veryfoodEN' )) {
    			meteor_slideshow( "vfhome" );
    			}
    		elseif ( is_page( 'azienda' )) {
    			meteor_slideshow( "vfazienda" );
    			}
    		elseif ( is_page( 'cosafacciamo' )) {
    			meteor_slideshow( "vfcosafacciamo" );
    			}
    		else
    			get_header_image(); //default-fallback if none of the above are true
    		}
    }
    ?>

    That looks almost right to me. On line 98 you have this code fragment that doesn’t make sense: <a>">. In the original file it’s <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> I’d guess that’s why you’re getting a white screen; if not, you’ll have to check through your code line by line for similar typos. (Or get a fresh copy of that file and insert your changes again, checking each one at a time).

    Also in our select function, you’ve got is_page( 'http://localhost:8888/veryfoodEN'. is_page can accept a few different types of variable, but as far as I know, it won’t work with a full URL. The slug that I mentioned, is the part you can see/edit, while you’re editing that page. Just under the title field. Most likely it would be is_page( 'veryfoodEN' or perhaps is_page( 'veryfooden'.

    all of the function text above is all that’s showing in place of the slideshow?

    To clarify, you mean when you view the site in your browser, you can see the code?
    If so, you just need to put <?php before the start of that code, and ?> after the end. Most template files are a mixture of html and php code. We use those two things to indicate the start and end of a section of php code.

    would another way of doing this (selecting between static images and slideshows) be to take it all out of the header.php and create another page template or 2 – and put the code in these templates instead?

    That’s possible -with some extra stuff to do – but since you’d have to create a page template for each individual page – and then maintain each one if you change something else in the page design – I wouldn’t recommend it.

    not all of the pages will need a slideshow in the header spot. 2 will require a static image like featured image, and one section no image at all (products). Do i just put if/else statements for these other pages too and set what they should be?

    Yes.

    Does your theme currently put featured images into the header area? If so, you should be able to use get_header_image() (with nothing inside the brackets) instead of meteor_slideshow( "slideshow-blah" ).

    Thread Starter Cormac Bracken

    (@the_other_mac)

    For a moment I thought this was a perfect and simple solution. But wp_is_mobile() returns TRUE even for full size tablets. Serving them a small-image slideshow wouldn’t look so great.

    I guess I could install Mobble and have something like

    if ( wp_is_mobile()&& !is_tablet() ) {
        meteor_slideshow( "mobile-slideshow", "" );
    }
    else ...

    Or a single slide slideshow. Or a static image reference. Decisions…

    oh i have made a menu with pages..

    Then forget my ramblings about categories and hooks, and stick with pages and directly editing the template.

    Can you set featured image to be a slideshow instead of a static pic?

    Nope. Well, you can achieve the effect you want, but not by using the featured image functionality.

    I have no idea how to do it

    Make a few slideshows, one for each page. Also decide which one is to be the default – probably one that should go on your home page. As you’re creating them, you’ll be asked to provide a slug. Make a note of each one. In my code above, these slugs appear as “slideshow-slug-1” etc.

    Make a few pages. The content can be blank for now, but you’ll need to provide a title. Then WP will automatically create a slug, which appears below the Title field in the page editor. You can edit that slug if you want. Make a note of each one. In my code above, *these* slugs appear as “page-slug-1” etc.

    Open headers.php. As I understand it, you’ve already put in a line there, to display a single slideshow. Delete that line, and paste the code above. Now modify the code, so that each is_page() contains one of the page slugs you noted, and each meteor_slideshow() contains the appropriate slideshow slug to match that page. For the last pair of lines, the else, put your default slideshow slug. If WP doesn’t recognise which page it’s on from the previous options, it’ll show this one. Typically that might be the homepage, but it could also be any other page, such as pages added after you’ve finished the design.

    This shows a few ways to do this:

    function rhl_select_slide_header() {
    	if ( function_exists( 'meteor_slideshow' ) ) {
    		if ( is_page( 'page-slug-1' ) {
    			meteor_slideshow( "slideshow-slug-1" );
    			}
    		elseif ( is_page( 'Page Title 2' ) {
    			meteor_slideshow( "slideshow-slug-2" );
    			}
    		elseif ( is_category( 'my-category' ) || in_category( 'my-category' ) ) {
    			meteor_slideshow( "slideshow-slug-3" );
    			}
    		else
    			meteor_slideshow( "slideshow-slug-4" ); //default-fallback if none of the above are true
    		}
    }

    Note that you need to create the pages, categories or slideshows first, so that you know what the slug text is; and if the site user later edits the slugs you’ll have to modify the code. Consider using posts instead of pages, and selecting based on category instead, as shown in 3rd choice above.

    I use something like this in functions.php, called with a hook. But off the top of my head, I believe you could drop that in place into headers.php.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    I put this code into my regular functions.php, which stops WP from putting width attributes on the div.

    add_filter( 'img_caption_shortcode', 'rhl_remove_caption_dimensions', 10, 3 );
    
    	function rhl_remove_caption_dimensions ( $val, $attr, $content = null )
    		{
    				extract(shortcode_atts(array(
    					'id'	=> '',
    					'align'	=> '',
    					'width'	=> '',
    					'caption' => ''
    				), $attr));
    
    			if ( empty($caption) )
    			return $val;
    
    			if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
    
    			return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '">' . do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>';
    		}

    There’s still an issue with using the visual editor. Inserting an image in visual mode just inserts regular thumbnail code, not the SRI code. And switching from html editor to visual and back, the SRI code is lost.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    – wpjaipho.php – remove if block in line 43 ($enabled variable should contain the result of user agent matching)

    This had no effect. I wasn’t sure what to expect, so I also inserted print_r ($enabled) before the if block – the result was 1.

    – functions.php – change jaipho_is_wp_gallery_call() to always return true (this will use wpjaipho’s gallery.php instead of theme attachment template)

    This worked, I finally saw wpjaipho’s output for the first time! But it’s not showing images from the gallery, in fact it’s showing unattached images.

    I went back to functions.php and realised that jaipho_is_wp_gallery_call is testing whether the post is of type “attachment”. But it’s not, it’s a normal post! (ie print_r ($post->post_type); outputs “post”) The post includes a gallery which is currently set to “file”. I set it to “attachment” (tested this before) and clicked a gallery thumbnail – it reloads the same page, NOT an attachment page. Disabled Jaipho and tried again – same result.

    To describe it more clearly, when the gallery type is set to “attachment” and I’m on /blah/post-name/, I go to a thumbnail and the url behind it is /blah/post-name/attachment/image123/ . But when I click on that url, I’m redirected back to /blah/post-name/ .

    Why? This made me think of “WordPress SEO” plugin by Yoast/Joost. (Yes I disabled this before, but perhaps not while gallery type=attachment). I checked and found that I had indeed set “Redirect attachment URL’s to parent post URL.” (Not sure if this is a default setting.) I disabled that and…. it works!

    To sum up, native WordPress gallery needs to be of type “attachment”, and if Yoast’s WordPress SEO plugin is enabled, users should go to that plugin’s settings, SEO -> Permalinks and uncheck the box “Redirect attachment URL’s to parent post URL.”

    You might want to add that to the documentation, as WordPress SEO is one of the most popular plugins.

    Thread Starter Cormac Bracken

    (@the_other_mac)

    Ok I did this and there are no errors or notices in the log, nothing unusual there.

    Of course if the jaipho code tests for the presence of something before using it, eg IF(function_exists), then it would fail without an error message. Does it test for anything else apart from userAgent?

    I mention nginx because I had an earlier issue with url parameters not being passed (which I corrected in the nginx config.) So I don’t see how nginx could influence this now, but perhaps you can give me an example of url structure used by jaipho.

Viewing 15 replies - 1 through 15 (of 19 total)