Forum Replies Created

Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter nblauw

    (@nblauw)

    Oke, thanks anyway!

    Thread Starter nblauw

    (@nblauw)

    I know $num_rows1 stands for the message count in my questbook, can i use the code above for the gallery for my questbook?

    Some code from dmsquestbook.php:

    // show DMSGuestbook entries
    	foreach ($query2 as $dbresult) {
    
    	if($var_sortitem=="ASC"){
    		$itemnr=($from++)+1;
    		}
    	if($var_sortitem=="DESC"){
    	$itemnr=($num_rows1 - $from++);
    
    $DMSGuestbookContent .= "<div class='css_navigation_totalcount'>($num_rows1)</div>";
    Thread Starter nblauw

    (@nblauw)

    Thanks you very much!
    It’s working!!

    You are amazing

    Thread Starter nblauw

    (@nblauw)

    Functions.php

    <?php
    
    class Hum_Theme {
    
    	public function __construct() {
    		// Late priority, to run after the parent theme's hook.
    		add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ), 20 );
    		add_action( 'customize_register', array( $this, 'customize_register' ), 20 );
    	}
    
     	public function after_setup_theme() {
    		// Disable Twenty Eleven's theme options page.
    		remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
    	}
    
    	// Remove Twenty Eleven's layout and color scheme customizer controls.
    	public function customize_register( $wp_customize ) {
    		$wp_customize->remove_section( 'twentyeleven_layout' );
    		$wp_customize->remove_control( 'twentyeleven_color_scheme' );
    	}
    };
    
    add_filter( 'the_title', 'do_shortcode' );
    add_shortcode( 'gallery_count', 'add_gallery_count' );
    add_filter('wp_nav_items', 'do_shortcode');
    add_filter( 'wp_title', 'do_shortcode' );
    add_filter( 'wp_list_pages', 'do_shortcode' );
    
    function add_gallery_count( $atts ) {
      global $post;
    
      if(isset( $post->post_content)) {
      	$gallery =  do_shortcode( $post->post_content );
      	if (preg_match_all( '/class=\'gallery-item\'\>/', $gallery, $matches ) ) {
    	  	$item_count = count( $matches[0] );
    	  	return $item_count;
    	 }
      }
    
    }
    
    new Hum_Theme;

    Thread Starter nblauw

    (@nblauw)

    I can see it on my dashboard (admin side of the website), i can see it on the page where the gallery is, but on the homepage i cant see it.

    Thread Starter nblauw

    (@nblauw)

    Added the 3 lines to functions.php from my HUM theme, but it is still not working.

    Thread Starter nblauw

    (@nblauw)

    In the sidebar left on the homepage in the menu you See ” fotoalbum ()”, when you click on it you go to the gallery. Look again at the menu and you See “fotoalbum (6)”

    Thread Starter nblauw

    (@nblauw)

    Its a page with a gallery on it
    https://bartbroersen.site50.net/?page_id=30
    When you on the page you See (6), But when on the homepage you See ().

    Thanks for helping!

    Thread Starter nblauw

    (@nblauw)

    I inserted the code in functions.php.
    Now Only in the page editor the number 6 shows up. ( like fotoalbum (6)) (Dashboard).
    When i go to my website it shows up like: fotoalbum ()
    (Bartbroersen.nl)

    How come?

    P.S.
    I edited functions.PHP of my theme HUM

    Thread Starter nblauw

    (@nblauw)

    Thanks!
    Same question for the DMSquestbook plugin on my site,
    How get the number of message in my questbook?

    Thanks again for your help!

    Thread Starter nblauw

    (@nblauw)

    Thank you very much!
    Where do I place the codes?

    Thanks for the quick response!

    Thread Starter nblauw

    (@nblauw)

    Posted on my mobile, sorry for that!

Viewing 12 replies - 16 through 27 (of 27 total)