Forum Replies Created

Viewing 15 replies - 1 through 15 (of 72 total)
  • Storm Rockwell

    (@stormrockwell)

    Were you looking for something like this? Pushed the width and height to “mediaDetails”

    add_action(
    	'rest_api_init',
    	function () {
    
    		if ( ! function_exists( 'use_block_editor_for_post_type' ) ) {
    			require ABSPATH . 'wp-admin/includes/post.php';
    		}
    
    		// Surface all Gutenberg blocks in the WordPress REST API
    		$post_types = get_post_types_by_support( [ 'editor' ] );
    		foreach ( $post_types as $post_type ) {
    			if ( use_block_editor_for_post_type( $post_type ) ) {
    				register_rest_field(
    					$post_type,
    					'blocks',
    					[
    						'get_callback' => function ( array $post ) {
    							$blocks = parse_blocks( $post['content']['raw'] );
    
    							foreach ( $blocks as $key => $block ) {
    								if ( $block['blockName'] === 'core/image' ) {
    									$meta = wp_get_attachment_metadata( $block['attrs']['id'] );
    									$blocks[ $key ]['mediaDetails'] = array(
    										'width' => $meta['width'],
    										'height' => $meta['height'],
    									);
    								}
    							}
    
    							return $blocks;
    						},
    					]
    				);
    			}
    		}
    	}
    );
    Storm Rockwell

    (@stormrockwell)

    To change the excerpt length add this to your child themes functions file and change the number 20 to the length you would like

    function wp11539068_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'wp11539068_excerpt_length', 999 );

    https://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_length

    Storm Rockwell

    (@stormrockwell)

    To truly remove the read more buttons add this to your child theme to overwrite the one in the main theme real-estate-lite-child/sections/service.php

    <?php
    $title = esc_html( get_theme_mod('service_title'));
    $subtitle = esc_html( get_theme_mod('service_sub_title'));
    $first = esc_html( get_theme_mod('first_service'));
    $second = esc_html( get_theme_mod('second_service'));
    $third = esc_html( get_theme_mod('third_service'));
    ?>
    <div class="section service grey">
            <div class="grid">
            <h2 class="section-title"> <?php echo esc_html( $title) ; ?></h2>
            <?php if(!empty($subtitle)) : ?>
            <h5 class="section-sub-title"> <?php echo esc_html( $subtitle) ; ?></h5>
            <?php endif; ?>
                    <?php 
           
                    // The Query
                    $args = array(
                            'post_type' => 'page',
                            'post__in' => array($first,$second,$third),
                            'orderby' => 'post__in',
                            );
                    $feature = new WP_Query( $args );
            // The Loop
                    if ( $feature->have_posts() ) {
                           
                                    while ( $feature->have_posts() ) {
                                            ?><div class="col-4-12"><?php
                                            $feature->the_post();
            if ( has_post_thumbnail() ) { ?>
                    <div class='post-thumb'>
                                    <a href="<?php the_permalink();?>" >
                                    <?php the_post_thumbnail('real_estate_lite_page_thumb'); ?>
                                    </a>
                    </div>
                    <?php } ?>
                    <?php the_title('<h2 class="entry-title">', '</h2>'); ?>
                    <?php  the_excerpt(); ?>
                                   
     
              <?php 
              echo "</div>";
              } } else { ?>
            <p><?php echo esc_attr( 'Sorry, no posts matched your criteria.' ); ?></p>
            <?php } 
                   
                    /* Restore original Post Data */
                    wp_reset_postdata();
                    ?>
                   
            </div>
            </div>

    An easier way but a bit less clean is to hide the links in the service section like so

    .service .read_more {
      display: none;
    }
    Storm Rockwell

    (@stormrockwell)

    if('#keyword'=="") should be if ( jQuery('#keyword').val() == "" )

    A better solution would be:

    function fetch() {
    	var input = $.trim( jQuery('#keyword').val() );
    
    	if ( input.length > 0 ) {
    		jQuery.ajax({
    		    url: "mywebsite/wp-admin/admin-ajax.php",
    		    type : "POST",
    		    data: { action: 'data_fetch', keyword: input },
    		    success: function(data) {
    			jQuery('#datafetch').html( data );
    		    }
    		});
    	}
    }

    Also if you prefer to use the $ for jQuery you can wrap your code in a closure like this:

    ( function( $ ) {
      // JS code
    } ( jQuery ) )

    `

    Forum: Requests and Feedback
    In reply to: Subdomains

    What is sounds like is you changed the domains nameservers. You would need to change the nameservers back to what they originally were. I’m not familiar with wix and if they have their own DNS you can use to setup the subdomains, you could do that too.

    By default, the taxonomy “categories” isn’t tied to Media. If you are trying to check for a specific taxonomy you would use is_tax()

    From my experience normally plugins have checks to ensure issues like this don’t occur. If you feel it’s not needed that’s your call and totally fine. I just won’t be able to use this plugin for future projects.

    This isn’t an issue with my host, this is an issue with migrating code bases.

    If the table fails to exist there should be checks in place to prevent this issue.

    Storm Rockwell

    (@stormrockwell)

    It looks like it fixed itself over time. I even tried a different browser to ensure it wasn’t cache haha.

    Storm Rockwell

    (@stormrockwell)

    Do you have any javascript errors? Possibly you update jQuery in the front-end but not the back-end. I know slick requires jQuery 1.7+ and core uses 1.4 i believe

    Storm Rockwell

    (@stormrockwell)

    Currently facing the same issue

    Storm Rockwell

    (@stormrockwell)

    Ignore this

    Version 4.16

    Went away eventually. Disable/enable doesn’t seem to immediately solve the issue.

    Occurred on another clients site when I transferred it to a local environment

    WordPress database error: [File './client/wp_WP_SEO_Cache.MYD' not found (Errcode: 2 - No such file or directory)]
    select * from wp_WP_SEO_Cache where ID='8';
    
    WordPress database error: [File './client/wp_WP_SEO_Redirection.MYD' not found (Errcode: 2 - No such file or directory)]
    select * from wp_WP_SEO_Redirection where enabled=1 and regex='' and ( redirect_from = 'http://localhost/' OR redirect_from = 'http://localhost' OR redirect_from = '' OR redirect_from = '/' OR redirect_from = '' OR redirect_from = '' OR redirect_from = 'http://localhost' OR redirect_from = 'http://localhost' OR redirect_from = '' OR redirect_from = '' OR redirect_from = '' OR redirect_from = '/' OR redirect_from = 'http://localhost/' OR redirect_from = 'http://localhost' )
    
    WordPress database error: [File './client/wp_WP_SEO_Redirection.MYD' not found (Errcode: 2 - No such file or directory)]
    select * from wp_WP_SEO_Redirection where enabled=1 and regex<>'' and ('http://localhost/' regexp regex or 'http://localhost' regexp regex ) order by LENGTH(regex) desc
    
    WordPress database error: [File './client/wp_WP_SEO_Cache.MYD' not found (Errcode: 2 - No such file or directory)]
    insert IGNORE into wp_WP_SEO_Cache(ID,is_redirected,redirect_from,redirect_to,redirect_type) values(8,0,'','',0);

    My process of migrating is pretty standard.

    Use wp-cli to export the database
    Transfer files with git
    wp-cli search-replace the db (url replacement)

    Awesome! I’m glad to hear

    Since the menu is purely CSS. The javascript error most likely isn’t affecting the navigation menu but it should be looked into. With some investigation, there are some issues with how the CSS implemented.

    A couple things I noticed:
    – positioned absolute below a different navigation item
    – .art-textblock-links has overflow hidden so the nav items will get cut off.

    I won’t be able to help with exactly how to implement the HTML/CSS in your theme but I hope this helps point you in the right direction.

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