Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter desirelabs

    (@desirelabs)

    Hello, I finally managed to give it another name and to hook on checkout process to save it as a meta. Because it seems like it’s not saved as it just using the field declaration. Or I missed something.
    BTW, if someone needs, I can give my full code.

    Thread Starter desirelabs

    (@desirelabs)

    Ok, the problem came from the fact I was looping on categories to get the matching post. What I had to do was to get the desired categories and use it in my $args + some adjustments.

    <?php
            // Get the parent cat thanks to the page's cat slug
            $parent_cat = get_category_by_slug( $cat[1] );
            $cats_args = array(
                'type'      => 'post',
                'child_of'  => $parent_cat->term_id
            );
            // child cats
            $categories = get_categories( $cats_args );
            // loop on the child cats to get the sub cats object
            if ($categories) {
                // empty array to store cats
                $cats = array();
                // Get the cat slugs and store it in an array
                foreach ($categories as $key => $value)
                    $cats[] = $value->slug;
                ?>
            <!-- THE TITLE -->
            <div class="text-seperator">
                <h2>Sector's programs</h2>
            </div>
            <ul class="sc_accordion">
            <?php
                $args = array(
                    'post_type' => 'editorial-posts',
                    'tax_query' => array(
                        'relation' => 'AND',
                        array(
                            'taxonomy' => 'category',
                            'field' => 'slug',
                            'terms' => $cats,
                            'include_children' => false
                        ),
                        array(
                            'taxonomy' => 'post_tag',
                            'field' => 'slug',
                            'terms' => array( 'short-description' )
                        )
                    )
                );
                $program_desc_short = new WP_Query( $args );
                ?>
                <?php if ($program_desc_short->have_posts()): while ($program_desc_short->have_posts()) : $program_desc_short->the_post() ?>
                    <?php
                    $terms = get_the_terms( get_the_ID(), 'category' );
                    $attached_category = array();
                    foreach ($terms as $term)
                        // in order to only get the concerned category, we check that the term is matching the cats array
                        if (in_array($term->slug, $cats))
                            foreach ($term as $key => $value)
                                $attached_category[$key] = $value;
                    ?>
                    <li><a class="sc_accordion-btn" href="#"><?php echo $attached_category['name'] ?></a>
                    <div class="sc_accordion-content">
                        <?php the_content(); ?>
                        <?php edit_post_link(__('Edit This'),'<p class="edit-link">' ,'</p>'); ?>
                        <a href="<?php echo '/sectors/'.$attached_category['slug'] ?>" class="btn small-btn right">Read more</a>
                    </div>
                <?php
                endwhile;
                endif;
                wp_reset_query();
            ?>
            </ul>
            <?php
            }
        ?>

    Thread Starter desirelabs

    (@desirelabs)

    I tried deactivating auto sort and menu_order. Even other sorting doesn’t work.

    Thread Starter desirelabs

    (@desirelabs)

    I was wrong, I didn’t watched out at the fact my code includes some text at the end of each post type, so posts as weel as the page (there excerpt).

    Same here. This is really weird as it ‘s installed on 2 Ubuntu machines, exactly the same config and php versions. One one it crashes, on the other one it doesn’t.

    Thread Starter desirelabs

    (@desirelabs)

    It seems like this plugin’s developer(s) just doesn’t mind at all the requests. Nice.

    Hello, same problem : The index disappeared after update to Version 2.7.4.

    Here are my installed plugins on WordPress 3.9.1
    Akismet 3.0
    CM Tooltip Glossary 2.7.4
    Contact Form 7 3.8.1
    Events Manager 5.5.3.1
    Juiz Social Post Sharer 1.3.5
    Revolution Slider 4.3.6
    Importateur WordPress 0.6.1
    WordPress SEO 1.5.3.3
    WP RSS Images 1.1

    Impossible to give you any access unfortunately for now. Woulf you please help.

    Thanks

    Hello, I had the same problem. To solve it, I modified the sf.php file like this :

    Find the head() function and cut the part :

    //wp_register_script('jquery');
    		$x = AJAXY_SF_PLUGIN_URL."js/sf.js";
    		$script = '
    		<script type="text/javascript">
    			/* <![CDATA[ */
    				var sf_position = '.$this->get_style_setting('results_position', 0).';
    				var sf_templates = '.json_encode($this->get_templates('more')).';
    				var sf_input = "'.(trim($this->get_style_setting('input_id', '.sf_input')) == "" ? '.sf_input' : $this->get_style_setting('input_id', '.sf_input')).'";
    				jQuery(document).ready(function(){
    					jQuery(sf_input).ajaxyLiveSearch({expand: '.$this->get_style_setting('expand', 'false').', searchUrl: "'.str_replace('"', '\"', $this->get_style_setting('search_url',  home_url().'/?s=%s')).'", text: "'.$label.'", delay:'.$this->get_style_setting('delay', 500).', iwidth:'.$this->get_style_setting('width', 180).', width:'.$this->get_style_setting('results_width', 315).', ajaxUrl:"'.$this->get_ajax_url().'"});
    				});
    			/* ]]> */
    		</script>';
    		echo $script.'<script src="'.$x.'" type="text/javascript"></script>
    		<!-- END -->';

    Put it un the empty footer() function.

    Go back top of the document in the actions() function and add a priority to wp_footer in order to make the scripts load after jquery :

    add_action( 'admin_footer', array(&$this, 'footer'), 100);

    Hope that’ll help ??

    And dear developers, please, try stopping adding scripts at the top, it’s a real pain in the neck, and try registering scripts like it should be, have a look at the wp_enqueue_script doc.

    Thanks for the work indeed ??

Viewing 8 replies - 16 through 23 (of 23 total)