Forum Replies Created

Viewing 15 replies - 1 through 15 (of 24 total)
  • Hello Anh,

    I am unable to display the text fields. Here is my code. pelase take a look

    add_filter( 'rwmb_meta_boxes', 'industrial_register_meta_boxes' );
    function industrial_register_meta_boxes() {
        // Code
    
        $prefix = 'rx_';
        // Main Specification
        $meta_boxes[] = array(
            'title'      => __( 'Main Specification	', 'textdomain' ),
            'post_types' => 'equipment',
            'fields'     => array(
                array(
                    'name' => __( 'X Axis Travel:', 'textdomain' ),
                    'id'   => $prefix . 'x_axis_travel',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Y Axis Travel:', 'textdomain' ),
                    'id'   => $prefix . 'y_axis_travel',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Z Axis Travel:', 'textdomain' ),
                    'id'   => $prefix . 'z_axis_travel',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Rapid Tranverse Rate:', 'textdomain' ),
                    'id'   => $prefix . 'rtr',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Spindle Speeds:', 'textdomain' ),
                    'id'   => $prefix . 'ss',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Spindle Motor:', 'textdomain' ),
                    'id'   => $prefix . 'sm',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Spindle Taper:', 'textdomain' ),
                    'id'   => $prefix . 'st',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Magazine Capacity:', 'textdomain' ),
                    'id'   => $prefix . 'mc',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Table Size:', 'textdomain' ),
                    'id'   => $prefix . 'ts',
                    'type' => 'text',
                ),
                array(
                    'name' => __( 'Max. Spindle Torque:', 'textdomain' ),
                    'id'   => $prefix . 'mst',
                    'type' => 'text',
                ),
            )
        );
        return $meta_boxes;
    }
    

    inside HTML i used this code
    <?php echo rwmb_meta( 'rx_x_axis_travel' ); ?>

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Hello Dartiss,

    I got this Thanks for the design reference you gave me. It helped a lot.

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    U R getting me wrong I was checking the source in the theme file https://www.competethemes.com/tracks-live-demo/ I checked that it is using archive template file for that design but can’t find out how he is putting the images to left on the next one. Because the source file for all the different post is same.

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    So far what I have understood is that the theme has 2 content template which he is getting displayed somehow

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Hello Dartiss,

    Please check the image at this link

    https://drive.google.com/file/d/0Bw28SdudShfHNWJYWDdiZlRyQnc/view?usp=sharing

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Hello Dartiss and Jan,

    Please check the image at this link

    https://drive.google.com/file/d/0Bw28SdudShfHNWJYWDdiZlRyQnc/view?usp=sharing

    I need to make the blog post to come like this with 4 post in a page.

    On the first post content should be on the left and featured image on the right
    then on the second post COntent on the right and featured image on the left.

    However, i tried searching on google but didn’t get any design refrence and code example.

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Someone pls help My all other CPt are working fine and give me the second pages correctly. But i m getting 404 error on the Photos Gallery The CPT is

    function create_image_gallery() {
    
      register_post_type( 'img_gallery',
    
        array(
    
          'labels' => array(
    
            'name' => __( 'Photos' ),
    
            'singular_name' => __( 'Photo' )
    
          ),
    
          'public' => true,
    
          'publicly_queryable' => true,
    
          'capability_type'     => 'post',
    
          'has_archive' => false,
    
          'menu_icon' => 'dashicons-images-alt2',
    
          'menu_position' => 32,
    
         'rewrite' => array( 'with_front'=> false,'slug' => 'photos' ),
    
          'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),
    
        )
    
      );
    
    }
    
    function image_gallery_flush_rules(){
      //defines the post type so the rules can be flushed.
      create_image_gallery();
      //and flush the rules.
      flush_rewrite_rules();
    }
    
    add_action('after_theme_switch', 'image_gallery_flush_rules');
    add_action('init', 'create_image_gallery');

    you can see the page here at https://prideofuttrakhand.org/photos/

    all other pages are going to second page but this one i don’t know what is wrong.

    Please help me…….

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    If you go to my site https://prideofuttrakhand.org/photos/

    You will see the pagination is giving correct url, however if I click on the next I m getting 404 error.

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    I made the CPT “home_slider” and taxonomy “Personalities”

    // Hook into the 'init' action
    
    add_action( 'init', 'custom_taxonomy_personalities', 0 );
    
    // Register Custom Taxonomy
    
    function custom_taxonomy_personalities() {
    
        register_taxonomy(
    
            'personalities',
    
            'hero_slider',        
    
            array(
    
                'labels' => array(
    
                    'name' => 'Personalities',
    
                    'add_new_item' => 'Add New Personalities',
    
                    'new_item_name' => "New Personalities"
    
                ),
    
                'show_ui' => true,
    
                'show_tagcloud' => true,
    
                'hierarchical' => true,
    
                'has_archive'=> true,
    
                'rewrite' => array( 'with_front'=> false,'slug' => 'personalities' ),
    
            )
    
        );
    
    }
    
    function create_post_type_hero_slider() {
    
      register_post_type( 'hero_slider',
    
        array(
    
          'labels' => array(
    
            'name' => __( 'Hero Sliders' ),
    
            'singular_name' => __( 'Hero Slider' )
    
          ),
    
          'public' => true,
    
          'has_archive' => true,
    
          'menu_icon' => 'dashicons-images-alt2',
    
          'menu_position' => 18,
    
          'capability_type' => 'page',
    
          'hierarchical' => true, 
    
          'rewrite' => array( 'with_front'=> false,'slug' => 'personalities' ),
    
          'supports' => array('editor','title','excerpt', 'thumbnail'),
    
        )
    
      );
    
    }
    
    function slider_flush_rules(){
    
      //defines the post type so the rules can be flushed.
    
      create_post_type_hero_slider();
    
      //and flush the rules.
    
      flush_rewrite_rules();
    
    }
    
    add_action('after_theme_switch', 'slider_flush_rules');
    
    add_action('init', 'create_post_type_hero_slider');

    I have made a page template :- page-personalities.php And put this code.

    <?php get_header();
    /*
     Template Name: Personalities
     */
    
     ?>
    <!--========================================================
    
                              CONTENT
    
    =========================================================-->
    
    <section id="content">
    
          <div class="cover_image">
    
                              <h2 class="entry-title"><?php the_title(); ?></h2>
    
                              <!-- a simple div with some links -->
    
                                    <div class="breadcrumbs" xmlns:v="https://rdf.data-vocabulary.org/#">
    
                                      <?php if(function_exists('bcn_display'))
    
                                            {
    
                                            bcn_display();
    
                                            }
                                      ?>
    
                                    </div>
          </div>
    <div class="bg_1 wrap_17">
            <div class="container">
                <div class="row">
                    <div class="grid_12">
                        <div class="row">
                              <?php
                                // WP_Query arguments
    
                                global $query;
                                $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
                                $args = array(
                                'post_type' => 'hero_slider',
                                'post_status' => 'publish',
                                'posts_per_page' =>12,
                                'paged'    => $paged,
                                'order'=> 'ASC',
                                'orderby'=> 'ID',
                                );
    
                                // The Query
                                $query = new WP_Query( $args );
                                foreach( $query->posts as $post ) :
                                //echo "<pre>"; print_r($post); 
    
                                 ?>
                            <div class="element-item grid_4">
                                <div class="box_7">
                                    <div class="img-wrap">
                                      <?php if (has_post_thumbnail()): ?>
                                         <a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'news', array( 'class' => '' ) ); ?></a>
                                      <?php endif ?>
                                     </div>
                                    <div class="caption">
                                        <h3 class="text_2 color_2"><a class="blog-title" href="<?php the_permalink() ?>"> <?php the_title(); ?> </a></h3>
                                        <p class="text_3">
                                           <?php echo $post->post_excerpt; ?>
                                        </p>
                                        <a class="btn_2" href="<?php the_permalink() ?>">read more</a>
                                      </div>
                                </div>
                            </div>
                            <?php
                              endforeach
                            ?>
                          </div>
                    </div>
                </div>
            </div>
        </div>
    
    <?php get_footer(); ?>

    Now this Code is showing me all the CPT queries for home_slider

    Now i have also made to page-template for taxonomies query
    and put code like this

    <?php

    /*

    Template Name: Sports
    */

    get_header(); ?>

    <!–========================================================

    CONTENT

    =========================================================–>

    <section id=”content”>

    <div class=”cover_image”>

    <h2 class=”entry-title”><?php the_title(); ?></h2>

    <!– a simple div with some links –>

    <div class=”breadcrumbs” xmlns:v=”https://rdf.data-vocabulary.org/#”&gt;

    <?php if(function_exists(‘bcn_display’))

    {

    bcn_display();

    }?>

    </div>

    </div>

    <div class=”bg_1 wrap_17″>
    <div class=”container”>
    <h1> Template – Sports</h1>
    <div class=”row”>
    <div class=”grid_12″>
    <div class=”row”><!–left side content –>

    <?php
    // WP_Query arguments

    global $query;
    $paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1;
    $args = array(
    ‘post_type’ => ‘hero_slider’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘personalities’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘sports’,
    ),
    ),
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ =>3,
    ‘paged’ => $paged,
    ‘order’=> ‘ASC’,
    ‘orderby’=> ‘ID’
    );

    // The Query
    $query = new WP_Query( $args );
    foreach( $query->posts as $post ) :
    //echo “

    "; print_r($post);
                                 ?>
                            <div class="element-item grid_4">
                                <div class="box_7">
                                    <div class="img-wrap">
                                      <?php if (has_post_thumbnail()): ?>
                                         "><?php the_post_thumbnail( 'news', array( 'class' => '' ) ); ?>
                                      <?php endif ?>
                                     </div>
                                    <div class="caption">
                                        <h3 class="text_2 color_2">"> <?php the_title(); ?> </h3>
                                        <p class="text_3">
                                           <?php echo $post->post_excerpt; ?>
                                        </p>
                                        ">read more</div>
                                </div>
                            </div>
                            <?php
                              endforeach
                            ?>
                          </div>
                    </div>
                </div>
            </div>
        </div> 
    
    <?php get_footer(); ?>
    
    now i don't know what i did wrong and how should i display it on the menu
    even taxonomy are showing up on the single page

    IF you have a HTml Version first cut them into sections
    HEader
    index
    footer
    siderbar

    now go to the function.php file and write this code.

    function twentythirteenchild_widgets_init() {
    
      register_sidebar( array(
    
        'name'          => __( 'Home Sidebar', 'twentythirteenchild' ),
    
        'id'            => 'sidebar-3',
    
        'description'   => __( 'Appears on posts and pages in the sidebar.', 'twentythirteenchild' ),
    
        'before_widget' => '<div class="wrap_10">',
    
        'after_widget'  => '</div>',
    
        'before_title'  => '<h2 class="header_2 indent_1">',
    
        'after_title'   => '</h2>',
    
      ) );
    
      register_sidebar( array(
    
        'name'          => __( 'Footer Sidebar', 'twentythirteenchild' ),
    
        'id'            => 'sidebar-4',
    
        'description'   => __( 'Appears in the footer section of the site.', 'twentythirteenchild' ),
    
        'before_widget' => '<div class="grid_4 widget_box">',
    
        'after_widget'  => '</div>',
    
        'before_title'  => '<h3 class="header_2">',
    
        'after_title'   => '</h3>',
    
      ) );
    
    }
    
    add_action( 'widgets_init', 'twentythirteenchild_widgets_init' );
    ?>

    Now Open the sidebar.php file and write this code

    if ( is_active_sidebar(‘sidebar-ID’) ) :
    dynamic_sidebar(‘sidebar-ID’); ?>

    <?php endif; ?>

    i hope that this will work for you.

    Sorry if i m unable to explain you properly. Let me know again

    Thread Starter Shashank Naithani

    (@shashank-naithani)

    I have made the custom Post type Like this

    / Hook into the 'init' action
    
    add_action( 'init', 'custom_taxonomy_personalities', 0 );
    
    // Register Custom Taxonomy
    
    function custom_taxonomy_personalities() {
    
        register_taxonomy(
    
            'personalities',
    
            'hero_slider',        
    
            array(
    
                'labels' => array(
    
                    'name' => 'Personalities',
    
                    'add_new_item' => 'Add New Personalities',
    
                    'new_item_name' => "New Personalities"
    
                ),
    
                'show_ui' => true,
    
                'show_tagcloud' => false,
    
                'hierarchical' => false,
    
                'has_archive'=> true,
    
            )
    
        );
    
    }
    
    function create_post_type_hero_slider() {
    
      register_post_type( 'hero_slider',
    
        array(
    
          'labels' => array(
    
            'name' => __( 'Hero Sliders' ),
    
            'singular_name' => __( 'Hero Slider' )
    
          ),
    
          'public' => true,
    
          'has_archive' => true,
    
          'menu_icon' => 'dashicons-images-alt2',
    
          'menu_position' => 18,
    
          'capability_type' => 'page',
    
          'hierarchical' => true, 
    
          'rewrite' => array( 'with_front'=> false,'slug' => 'personalities' ),
    
          'supports' => array('editor','title','excerpt', 'thumbnail'),
    
        )
    
      );
    
    }
    
    function slider_flush_rules(){
    
      //defines the post type so the rules can be flushed.
    
      create_post_type_hero_slider();
    
      //and flush the rules.
    
      flush_rewrite_rules();
    
    }
    
    add_action('after_theme_switch', 'slider_flush_rules');
    
    add_action('init', 'create_post_type_hero_slider');

    I Have made a Custom template page-personalities.php.
    But in this page i am only getting all the post.

    Now what i want is to get CPT taxanomies to display on different pages as per their categories.

    For this i made custom taxonomy template like this taxonomy-personalities-arts-culture.php.

    Now even i m confused how WP treat this page.
    Like is it used to display all the Related post of Art and cultre.

    Or it will act as single page for the Art and cultre taxanomy

    Please guide me how to make seperate pages for the CPT taxanomy

    U can check CPT page Here But i don’t know what i m doing wrong.

    Forum: Fixing WordPress
    In reply to: Problem With URLs
    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Thanks Eric, You replied for my problem and because of that i didn’t loose hope. Now in future projects i can make things work more quick.

    Forum: Fixing WordPress
    In reply to: Problem With URLs
    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Hi Eric,

    The problem is solved I used the custom Permalink like in the image
    https://drive.google.com/file/d/0Bw28SdudShfHSlJsTWFYWmJDaG8/view

    and used
    'rewrite' => array( 'with_front'=> false,'slug' => 'news' ),

    Now i m getting a the separate section of news in the URL and its SEO friendly too.

    Thanks for helping me out \\m//

    Forum: Fixing WordPress
    In reply to: Problem With URLs
    Thread Starter Shashank Naithani

    (@shashank-naithani)

    Hello Eric I checked both plugins, however I m not getting any help from them as I have change my permalink to /blog/%post-name% , the blog section url is coming fine, however
    WordPress is taking the news section ( news custom post type) under blog like this /blog/ news/%post-name%.

    And my urls doesn’t have any taxonomy so the second plugin is not useful for me now.

    Please see the captured images of the permalink settings I have done.
    https://drive.google.com/file/d/0Bw28SdudShfHSlJsTWFYWmJDaG8/view
    https://drive.google.com/file/d/0Bw28SdudShfHT19XNFNRZ2hvYkE/view

    I guess the database does not have enough info. Import the database from xammp to the site server. I think it will solve ur issue

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