Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • unfortunately even your solution generated an error message:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'loading_scripts' not found or invalid function name in [my physical path]/wp-includes/class-wp-hook.php on line 286

    I tried to move the function in my functions.php, and assign an arbitrary value to $js_ver and $css_ver. error messages seem to be gone away, but the plugin didn’t work properly.

    ok, when activated in an individual site of the network it works fine, thanks.

    Hello,

    I have the same issue: on a multisite installation categories don’t show after I install and activate the plugin on the primary site. they reappear once I disactivate the plugin.

    the plugin appear to be already activate in the plugin section of the subsite, I can’t deactivate it.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    I found a workaround that seems to do the job (closing the menu for internal navigation with mobile).

    inspecting the mobile hamburger menu button I found the data-toggle=”collapse” and data-target attributes used by Bootstrap.

    I attached the same attributes and values to the menu item links of the menu via javascript so that they’ll perform the same actions of the hamburger menu.

    the javascript code is this:

    var menuItems = document.querySelectorAll('li.menu-item a');
    
    var i = menuItems.length;
    
    while (i--) {
    	menuItems[i].setAttribute('data-toggle', 'collapse');
    	menuItems[i].setAttribute('data-target', '.nav-collapse');
    }

    it could have been even more compact using jquery, but for such an elementary task I preferred raw js.

    the recommended method to add custom js code to a theme is to write it in a separate file and then enqueueing it with a custom function in functions.php, and then trigger that function with the wp_enqueue_scripts action, and that’s what I did. I created a new scripts.js file in my child theme directory, and enqueued it in the child theme’s functions.php file:

    add_action('wp_enqueue_scripts', 'add_my_scripts');
    function add_my_scripts() {
      wp_enqueue_script( 'my_scripts', get_stylesheet_directory_uri() . '/scripts.js', array(), '0.1', true);
    }

    that did the job.

    anyway, that’s all the js code I need on my customizr child theme, and I didn’t like to add a separate file and to trigger file I/O actions just to add 4 js rows of code, so I searched for the possibility to add them directly in functions.php.

    the only way I found to be possible (but there may be others) was to use the __after_footer action to trigger a function that would echo the js code in the footer before the </body> tag:

    add_action('__after_footer', 'add_js_setAttr_menu');
    function add_js_setAttr_menu() {
    
    	echo '
    		<script>
    		var menuItems = document.querySelectorAll(\'li.menu-item a\');
    		
    		var i = menuItems.length;
    		
    		while (i--) {
    			menuItems[i].setAttribute(\'data-toggle\', \'collapse\');
    			menuItems[i].setAttribute(\'data-target\', \'.nav-collapse\');
    		}
    		</script>
    
    	';
    
    }

    of course this also worked fine, but in the end I preferred to use the wp_enqueue_scripts method for being more general.

    today, during a periodical maintenance check on an website for a congress of some month ago, I saw the warning notification we are talking about in this thread.

    first thing: after reading all the comments here and after having backupped (as always) I decided to upgrade and everything is fine both in the front and in the back end.

    that said, I am very grateful for this very good free theme, so I hope my observations would be seen as positive as they intend to be.

    if I read something like “WARNING: There is a big Responsive Theme update available. Please read the update page before updating”, it means to me: “do NOT upgrade before reading the update page because IF YOU DON’T READ IT and DON’T TAKE ACTIONS something could go TERRIBLY BAD and it will be YOUR FAULT”.

    so basically I do not upgrade until I read it all, fine prints included.

    now, the link is not actually broken, but it lead to a page that says “Expired Account
    The HubSpot account associated with the domain “content.cyberchimps.com” has expired”. so there’s no way I can read what the upgrade is about and if there’s something I MUST do to avoid things going REALLY BAD. also “expired account” automatically make think something like “they’re OUT OF BUSINESS!”. if you are a beginner and you’re not used to search in forums etc. you’ll get anxious.

    so I suggest to modify the link to point to a cyberchimps.com owned page that says “the major update we’re talking about regards substantial improvements in the administration interface, please look at our efforts to give you a better content admin interface. and by the way, all your frontend content, plugins, custom stuff in functions.php and style.css etc. are safe and will work as intended.”

    in the end, I made some significant custom alterations before the major upgrade, so my website wasn’t just a plain vanilla Responsive child, and I upgraded without any problem, so if you’re in the same situation, I’d advise to upgrade.

    thanks again to Cyberchimps for the theme and for the clarification messages here.

    lucaboccianti

    (@lucaboccianti)

    every “section” is nested inside <section id=”section-n”>, where n is 1, 2, 3…

    ...
    <section id="section-3" class="section magee-section alchem-home-section-2 alchem-home-style-1">
    ...
    </section>
    <section id="section-4" class="section magee-section alchem-home-section-3 alchem-home-style-1">
    ...
    </section> 
    ...

    with a tool to inspect the source, like firebug or others, right click near the section you want to make a menu entry to. most modern browsers will show some “inspect” options when you right click near the item you’re interested.

    in my setup the section “Recent Works” has id=”section-4″.

    to make a menu link for Recent Works, I’ll go to Menu, Add custom link (I’m not using the administration back end in english right now so the labels may differ a little), in the URL field I’ll write #section-4, and I’ll write Recent Works, or whatever label I like. That menu item will make the page scroll to Recent Works section.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    ok, I’ve found a possible workaround, but I don’t know if this is the intended way to go.

    when one add home page sections (i.e. widget areas) in the theme specific settings, the section title are marked with a specific id, for instance meris_home_title-2:

    <div class="widget home_widget_title" id="meris_home_title-2">
      <div class="title-wrapper">
        <h2 class="module-title">My First Section Title</h2>
          <p class="module-description">My First Section Subtitle</p>
          ...

    same as above, with chrome, ff, opera, ie, safari. plugin activated, no scroll after save/update. plugin deactivated, save/update, scroll ok. maybe something related with plugin’s css?

    Thread Starter lucaboccianti

    (@lucaboccianti)

    thanks kmessinger, but if I’m not wrong that function can be used only when dealing with registered users and not with anonymous ones.

    for several reasons, on the website I’m working it was decided that the users could/should stay anonymous.

    what I need is for a casual user to enter a given password on a form and then having this password stored on a cookie or on a session var to avoid to ask him/her the pw again.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    using session variables I sort of obtained what I wanted, still I’d have preferred to use cookies because I could leave them set for longer than session vars. with sessions the user need to re-enter a code every time s/he turn off the browser or the computer, while I would have preferred to leave a cookie lasting say a week.

    I’m still very interested in wordpress and cookie, anyway.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    thanks for your answer. I was aware of that and this is the method I normally use.

    maybe I need to clarify my question. I was just thinking: what if the developer of the parent theme update the theme and significantly modify the parent header.php with new functionalities etc.. I would have to rewrite the child header.php.

    ok, no big deal, but maybe delegating the child functions.php to do the job would avoid the necessity of rewriting header.php.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    your reply start with “no”. “no” to what?

    let me be picky as you and the other short-answer guy tried to be. I said Twentyeleven is suggested as *a* standard parent theme. now, I’m not english mothertongue, but if I’m not wrong *a* should mean “one of the many possible standard themes”.

    so first you say no to what I said, then you said it.

    I read from the Twentyeleven page: “The 2011 theme for WordPress etc.”. again, I’m not english mothertongue but I interpret that sentence like a sort of official wp org endorsement as Twentyeleven as *the* standard starting point for theme development among the many possible ones.

    I may not have given the impression of knowing that, but before you explain it to me, let me assure you I know I can use almost any properly coded theme as parent, and I also know about the existence of framework themes intended for child development, and that I used them. I just wanted to use “*The* 2011 theme for wordpress”.

    anyway, now that you demonstrated you’re good with short answers, I would like to ask you, too, if you want to elaborate about the choice of not displaying the sidebar, and your opinion about the coherence of the admin interface when it ask where to display the sidebar and then in many occasions the sidebar isn’t displayed it at all.

    maybe I’m really missing something important here and your help in understanding this choice could be useful.

    thanks.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    you mean, really? can I? who could have said it.

    well, I’ll desing a new theme where I’ll leave the option of showing or not showing the sidebar, but the sidebar will be always shown no matter what you choose.

    then when people ask “hey, why the sidebar is still there when I ask it to disappear”, I’ll say “hey, it’s a theme, choose or design yourself a new one if you don’t like it”.

    problem is, the theme I’m talking about is the standard wp theme that’s also suggested as a standard parent theme for child theme development.

    it seems you have a somewhat official position in this forum, maybe you can elaborate on the rationale of choosing the sidebar not to be displayed by default.

    Hello Arthur,

    at a quick look, I’d say that the $param variable should be used to filter the $tags array. I guess you could write there the name of the current tag.

    If this doesn’t work one could try to filter the $tags array, but this could be difficult to obtain with native php methods because $tags elements are object variables.

    A crude method would be to run through all the array but echoing only if the tag name is the one you want:

    <?php
    $tags = (array) nggTags::find_tags($param, true);
    foreach( $tags as $tag ) {
    	if(esc_html( $tag->name ) == $your_tag_name) {
    		echo '<li><span>' . esc_html( $tag->name ). '</span>&nbsp;'.'('. esc_html( $tag->count ).')</li>'."\n";
    		break;
    	}
    }
    unset($tags);
    ?>

    while I am here, another thing. unfortunately I noticed only now that very long time ago you asked me about my hack to display a gallery selected by using multiple tags in a logical AND fashion:

    https://tinyurl.com/7oh7two

    let me know if you still wish help with that.

    Thread Starter lucaboccianti

    (@lucaboccianti)

    ok, I just realized about a bug. sorry I can’t edit the original message.

    the first method should be:

    /**
    	 * nggTags::find_images_id_for_tags_and()
    	 *
    	 * @param mixed $taglist
    	 * @param string $mode could be 'ASC' or 'RAND'
    	 *
    	 * @return array of images ID's that are tagged with ALL
    	 * the tags in $taglist.  if $taglist is "cheap, paris, restaurant"
    	 * it will return an array of IDs of images tagged
    	 * cheap AND paris AND restaurant (and not images tagged cheap OR
    	 * paris OR restaurant)
    	 *
    	 * the ID's array can be passed to a find image in db function
    	 * if one need to display a gallery of such images.
    	 *
    	 * otherwise one may use the ID's in nggSinglePicture() function or similar.
    	 *
    	 */
    	function find_images_id_for_tags_and($taglist, $mode = "ASC") {
    		// return the images based on the tag
    		global $wpdb;
    		// extract it into a array
    		$taglist = explode(",", $taglist);
    		if ( !is_array($taglist) )
    			$taglist = array($taglist);
    		$tag_count = count($taglist);
    		$taglist = array_map('trim', $taglist);
    		$new_slugarray = array_map('sanitize_title', $taglist);
    		$sluglist   = "'" . implode("', '", $new_slugarray) . "'";
    
    		$ssql = "
    			SELECT rln.object_id
    			FROM " . $wpdb->term_relationships . " rln
    
    			INNER JOIN " . $wpdb->term_taxonomy . " txn
    			ON rln.term_taxonomy_id = txn.term_taxonomy_id
    
    			INNER JOIN " . $wpdb->terms . " terms
    			ON txn.term_id = terms.term_id
    
    			WHERE terms.slug IN (" . $sluglist . ")
    
    			GROUP BY rln.object_id
    			HAVING COUNT(rln.object_id) >= " . $tag_count . "
    		";
    
    		$picids = $wpdb->get_col($wpdb->prepare($ssql));
    
    		return $picids;
    
    	}

    otherwise say you have images tagged “cheap, restaurant, amsterdam” or “expensive, restaurant, paris” they will be listed too.

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