ElwoodP
Forum Replies Created
-
Hi Mihai,
Thanks for getting back to me. Doesn’t look like there is anything relevant in PHP log.
impro.log can be downloaded from here:
https://dl.dropboxusercontent.com/u/3454522/impro.logDoes that help? Otherwise let me know and I’ll set up an account for you.
Thanks for your help.
Forum: Plugins
In reply to: [Recent Posts Widget Extended] Does not updateAh, I see it. I have set it to 1 and it works fine.
Thanks!
Forum: Plugins
In reply to: [Recent Posts Widget Extended] Does not updateHi Satrya,
Nice plugin..
Still doesn’t update with new/delete post for me. Is this meant to happen with 0.7.1or is the change coming?Actually in Firefox I can drag the image in. However thumbs still do not load.
See screenshot4Forum: Plugins
In reply to: WordPress, Jquery BBQ, and IsotopeHi bbart10,
I’ve just integrated jQuery BBQ onto a site to achieve what you describe. There is an example of BBQ itnegration with Isotope here:
https://isotope.metafizzy.co/demos/hash-history.html
and a tutorial here:
https://isotope.metafizzy.co/docs/hash-history-jquery-bbq.htmlI didn’t find the tutorial totally usefull though since it doesn’t cover how to update the Navigation. I ended up stripping the javascript out of the example page (inline at the bottom of the page):
$(function(){ var $container = $('#container'), // object that will keep track of options isotopeOptions = {}, // defaults, used if not explicitly set in hash defaultOptions = { filter: '*', sortBy: 'original-order', sortAscending: true, layoutMode: 'masonry' }; // add randomish size classes $container.find('.element').each(function(){ var $this = $(this), number = parseInt( $this.find('.number').text(), 10 ); if ( number % 7 % 2 === 1 ) { $this.addClass('width2'); } if ( number % 3 === 0 ) { $this.addClass('height2'); } }); var setupOptions = $.extend( {}, defaultOptions, { itemSelector : '.element', masonry : { columnWidth : 120 }, cellsByRow : { columnWidth : 240, rowHeight : 240 }, getSortData : { symbol : function( $elem ) { return $elem.attr('data-symbol'); }, category : function( $elem ) { return $elem.attr('data-category'); }, number : function( $elem ) { return parseInt( $elem.find('.number').text(), 10 ); }, weight : function( $elem ) { return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') ); }, name : function ( $elem ) { return $elem.find('.name').text(); } } }); // set up Isotope $container.isotope( setupOptions ); var $optionSets = $('#options').find('.option-set'), isOptionLinkClicked = false; // switches selected class on buttons function changeSelectedLink( $elem ) { // remove selected class on previous item $elem.parents('.option-set').find('.selected').removeClass('selected'); // set selected class on new item $elem.addClass('selected'); } $optionSets.find('a').click(function(){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { return; } changeSelectedLink( $this ); // get href attr, remove leading # var href = $this.attr('href').replace( /^#/, '' ), // convert href into object // i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' } option = $.deparam( href, true ); // apply new option to previous $.extend( isotopeOptions, option ); // set hash, triggers hashchange on window $.bbq.pushState( isotopeOptions ); isOptionLinkClicked = true; return false; }); var hashChanged = false; $(window).bind( 'hashchange', function( event ){ // get options object from hash var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {}, // do not animate first call aniEngine = hashChanged ? 'best-available' : 'none', // apply defaults where no option was specified options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } ); // apply options from hash $container.isotope( options ); // save options isotopeOptions = hashOptions; // if option link was not clicked // then we'll need to update selected links if ( !isOptionLinkClicked ) { // iterate over options var hrefObj, hrefValue, $selectedLink; for ( var key in options ) { hrefObj = {}; hrefObj[ key ] = options[ key ]; // convert object into parameter string // i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition' hrefValue = $.param( hrefObj ); // get matching link $selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]'); changeSelectedLink( $selectedLink ); } } isOptionLinkClicked = false; hashChanged = true; }) // trigger hashchange to capture any hash data on init .trigger('hashchange'); });
I then removed a few setup bits since I already had isotope working and changed a couple of IDs and classes to match my markup. Ended up with this:
jQuery(function($){ var $container = $('#containerp'), // object that will keep track of options isotopeOptions = {}, // defaults, used if not explicitly set in hash defaultOptions = { filter: '*', sortBy: 'original-order', sortAscending: true, layoutMode: 'masonry' }; var $optionSets = $('#projects').find('#filterNav'), isOptionLinkClicked = false; // switches selected class on buttons function changeSelectedLink( $elem ) { // remove selected class on previous item $elem.parents('#filterNav').find('.selected').removeClass('selected'); // set selected class on new item $elem.addClass('selected'); } $optionSets.find('a').click(function(){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { return; } changeSelectedLink( $this ); // get href attr, remove leading # var href = $this.attr('href').replace( /^#/, '' ), // convert href into object // i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' } option = $.deparam( href, true ); // apply new option to previous $.extend( isotopeOptions, option ); // set hash, triggers hashchange on window $.bbq.pushState( isotopeOptions ); isOptionLinkClicked = true; return false; }); var hashChanged = false; $(window).bind( 'hashchange', function( event ){ // get options object from hash var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {}, // do not animate first call aniEngine = hashChanged ? 'best-available' : 'none', // apply defaults where no option was specified options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } ); // apply options from hash $container.isotope( options ); // save options isotopeOptions = hashOptions; // if option link was not clicked // then we'll need to update selected links if ( !isOptionLinkClicked ) { // iterate over options var hrefObj, hrefValue, $selectedLink; for ( var key in options ) { hrefObj = {}; hrefObj[ key ] = options[ key ]; // convert object into parameter string // i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition' hrefValue = $.param( hrefObj ); // get matching link $selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]'); changeSelectedLink( $selectedLink ); } } isOptionLinkClicked = false; hashChanged = true; }) // trigger hashchange to capture any hash data on init .trigger('hashchange'); });
Hope that helps. I’m no javascript expert but this seems to work.
Forum: Fixing WordPress
In reply to: Moving WordPress within same serverLol that was easy.. Just changed directory in:
Admin Panel > Settings > Media > Store uploads in this folder
Forum: Hacks
In reply to: Code to check user role and load custom CSS for dashboardWorked it out:
add_action('admin_head','load_editor_style'); load_editor_style() { $templateuri = get_template_directory_uri(); if(current_user_can('editor')){ wp_enqueue_style('editorstyle', $templateuri.'/css/editorstyle.css'); } } ?>
Forum: Fixing WordPress
In reply to: Parent Theme Briefly VisibleIs this not just a problem with the way that child themes work/browsers load pages (I.E. The page loads parent theme’s css parts of which are subsequently superseded by child themes css, and the browser displays page whilst it is loading, catching this happening).
It doesn’t seem to me that there is a problem with the parent theme.
I thought this might be a common problem?
Forum: Fixing WordPress
In reply to: Parent Theme Briefly VisibleParent Theme:
https://demo.brankic.net/?theme=DesignvilleWPSite with child theme:
https://www.martinerobertson.com.au/This seems to work…
private function build_categories($post_type, $taxonomy = FALSE, $parent = 0) { $tree = array(); if ($parent) { //$taxonomy = $this->get_taxonomy_get_term($parent); //firstly render the list of sub categories $cat_list = get_terms($taxonomy, array('get' => 'all', 'parent' => $parent, 'hide_empty' => 0)); if (is_array($cat_list)) { foreach ($cat_list as $category) { $tree[] = $this->build_category($category); } } } else { $taxonomies = get_object_taxonomies($post_type); foreach ($taxonomies as $taxonomy) { if (is_taxonomy_hierarchical($taxonomy)) { $term_list = get_terms($taxonomy, array('parent' => $parent, 'hide_empty' => 0)); if (is_array($term_list)) { foreach ($term_list as $term) { $tree[] = $this->build_category($term); } } } } }
Thanks Vasyl. I’m very new to WordPress so might get this wrong! – If you are using something like “get_terms” function can you not just set “hide_empty” argument to 0?
Jus doesn’t seem to make sense to exclude categories with no posts in this instance (especially when they could have children with posts).
Great plugin by the way. I tried a few similar plugins but found Access Manager by far the best solution for me. Seems powerful yet easy to use. Perfect combination!