Forum Replies Created

Viewing 15 replies - 706 through 720 (of 927 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    @tonybearblog, your server might be missing the PHP module called mbstring. That is the normal cause of my plugin not completing a page render. If it is this issue it should be shown in you server’s error_log file.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Yes, those two lines are back-to-front. It should have the <div><ul> before the <?php

    Plugin Author Dani Llewellyn

    (@diddledani)

    Yes, this is possible, but you will need to edit some CSS, or the template, which is written in PHP and HTML, probably both.

    The following might do the job but is untested. You will need to save this into a file in your theme’s directory called a-z-listing.php. It includes CSS, HTML and PHP changes which I hope do the job for you. If you want a different number of columns then change the 3 in the second line for the number you prefer:

    <?php
    $_a_z_listing_colcount = 3;
    ?>
    <style>
    	.letter-section ul {
    		display: flex;
    		flex-direction: row;
    		flex-wrap: wrap;
    		display: grid; // duplicate display because grid might be unsupported in a particular browser, in which case the flex will be used
    		grid-template-columns: <?php for ($col = 0; $col < $_a_z_listing_colcount; $col++) { echo 'calc( 100% / ' . $_a_z_listing_colcount . ') '; } ?>;
    		grid-auto-flow: row;
    	}
    	.letter-section li {
    		box-sizing: border-box;
    		float: left;
    		width: calc( 100% / <?php echo esc_html( $a_z_listing_colcount ); ?> );
    	}
    </style>
    <div id="letters">
    	<div class="az-letters">
    		<?php $a_z_query->the_letters(); ?><div class="clear empty"></div>
    	</div>
    </div>
    <?php if ( $a_z_query->have_letters() ) : ?>
    <div id="az-slider">
    	<div id="inner-slider">
    		<?php
    		while ( $a_z_query->have_letters() ) :
    			$a_z_query->the_letter();
    		?>
    			<?php if ( $a_z_query->have_items() ) : ?>
    				<div class="letter-section" id="<?php $a_z_query->the_letter_id(); ?>">
    					<h2>
    						<span><?php $a_z_query->the_letter_title(); ?></span>
    					</h2>
    					<?php
    					<div><ul>
    					while ( $a_z_query->have_items() ) :
    						$a_z_query->the_item();
    					?>
    						<li>
    							<a href="<?php $a_z_query->the_permalink(); ?>"><?php $a_z_query->the_title(); ?></a>
    						</li>
    					<?php endwhile; ?>
    					</ul></div>
    					<div class="clear empty"></div>
    				</div>
    			<?php endif; ?>
    		<?php endwhile; ?>
    	</div>
    </div>
    <?php else : ?>
    	<p><?php esc_html_e( 'There are no posts included in this index.', 'a-z-listing' ); ?></p>
    <?php
    endif;
    
    • This reply was modified 8 years, 7 months ago by Dani Llewellyn. Reason: forgot to set flexbox
    • This reply was modified 8 years, 7 months ago by Dani Llewellyn. Reason: add display:grid for really new browsers
    • This reply was modified 8 years, 7 months ago by Dani Llewellyn. Reason: add automatic grid sizing
    Plugin Author Dani Llewellyn

    (@diddledani)

    To specify a custom-post-type you would use the shortcode as:

    [a-z-listing post-type="your-plugins-post-type-slug"]
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    Are you displaying a list of terms from a taxonomy, or are you wanting to filter a list of posts by excluding any posts who have the term in question?

    For the first, displaying a list of terms from a taxonomy, it is currently not possible to filter the list in any way (unless I’ve forgotten about it, which is entirely possible πŸ™‚ ).

    If you are displaying a list of posts and wish to exclude posts who have a specific term assigned, then this is possible via PHP, but not via the shortcode. For excluding via PHP you would recite the magic words:

    the_a_z_listing( array(
        'post_type' => 'your_post_type',
        'tax_query' => array( array(
            'taxonomy' => 'your-taxonomy', # this is a taxonomy slug
            'field' => 'slug', # this says that we're using slugs in the 'terms' array below
            'terms' => array( 'your-terms' ), # these are term slugs and any number of them are allowed
            'operator' => 'NOT IN',
        ) ),
    ) );
    
    Plugin Author Dani Llewellyn

    (@diddledani)

    Provided the other plugin uses a post-type to store it’s content then yes, you just need to find-out the post-type slug to pass into my plugin. The easiest way to do this, if your plugin is doing things in this way, is to go to the add-new page for the plugin’s content and check the browser address-bar. It should read something like:

    http://yoursite.example.com/wp-admin/edit.php?post_type=slug-goes-here
    

    Copy the text which appears in-place of my example slug-goes-here (everything after the post_type= and before any & symbols if there are any present). That will give you the post-type name to use in the shortcode:

    [a-z-listing post-type="slug-goes-here"]
    
    Forum: Plugins
    In reply to: [A-Z Listing] Blank page
    Plugin Author Dani Llewellyn

    (@diddledani)

    it looks like PHP died part-way through creating the page to send to the browser. The web-server’s error_log should include an explanation in the form of an error message. My guess is that you’re missing the mbstring PHP module on your web server. (I really need to put that requirement in the readme!)

    Plugin Author Dani Llewellyn

    (@diddledani)

    Don’t worry, it’s not a problem at all. If I can still help in any way, I will try to do so.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Aha, I think we’re talking cross-purposes here. It looks like you’re using a different plugin, not mine πŸ™‚ Your page has an identification that you’re using AZIndex, whereas my plugin is A-Z-Listing. I think you probably want to talk with “English Mike” over at http://azindex.englishmike.net because I don’t have anything to do with that plugin so probably can’t help you very well with customising it, though I will help as much as I can.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    I don’t think I really understand the concept here, but that is probably me just misunderstanding, so please forgive my deficiency πŸ™‚ I’ve tried to outline some thoughts below anyway.

    The plugin will sort the listing alphabetically by default. Even if you customise the sorting mechanism the customisation will apply to an entire A-Z List and cannot affect a single sub-section. If you have multiple A-Z Lists you can apply customizations to each full-list independently of the others via judicious add_filter() and remove_filter(), but cannot affect just a small part of each list.

    The comparison function works the same as PHP’s usort() function, where the function takes two parameters and if the first is to appear in the list first then it returns -1, if both items are equal in their value and so there is no requirement for one to have precedence over the other then return 0, and if the second item should appear first then return 1.

    The idea I had when I implemented that customisation was to allow for languages where it is less clear what the order should be to PHP so I allow the site owner to add logic to sort the items into their preferred order. For example, if a language has characters which are ordered differently in the Unicode numbers to their preferred local system then the site owner can create a function to ignore the Unicode numbers and order the titles arbitrarily based on the -1, 0 and 1 comparison of PHP’s usort() function.

    Plugin Author Dani Llewellyn

    (@diddledani)

    It cannot be done now. I don’t think it will be easy to do in the future and do not see much need as you can pull the sub-categories into a new taxonomy and display that instead.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    Depending on how you save the information it should be possible, but may take a bit of programming effort. Specifically, I would envisage having your links as a new post type which you set the a-z listing to display, and you customise the template to link to your offsite locations using post-meta fields to save the URL. So you’d replace in the template the call to the_permalink() with an appropriate call to get_post_meta() to pull the correct address.

    Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    It is not possible as the plugin exists right now. As an alternative I would suggest copying or moving the terms into a new taxonomy specifically for them. Then you’d display that taxonomy instead of category.

    Forum: Plugins
    In reply to: [A-Z Listing] Right To Left
    Plugin Author Dani Llewellyn

    (@diddledani)

    Good question. I haven’t made provision for right-to-left of the letters. At the moment it’s supposed to use a CSS rule that sets display: flex, and for browsers that don’t support flexbox it uses float: left. It appears I got the display:flex wrong and it isn’t being used currently, which I’ll fix in the next update.

    To change the defaults you will need to add a new CSS file or use the Custom CSS feature in wp-admin -> appearance -> customize -> additional css.

    I think the required CSS to flip the order, which will still work in the next release when I fix flexbox, would be as follows:

    .az-letters ul.az-links {
        flex-direction: row-reverse;
    }
    .az-letters ul.az-links li {
        float: right;
    }
    Plugin Author Dani Llewellyn

    (@diddledani)

    Awesome! πŸ™‚ I’m really glad my plugin is working for you..

Viewing 15 replies - 706 through 720 (of 927 total)