1

I am new in here. I actually do not understand really it a WordPress related question or not. I think it is. My site runs into WordPress. My question is when someone clicks my post it shows a download button with some text. If someone clicks 'download' button it loaded and open a new page with another two download buttons. When they again click one of them it open again new page. The permalink still the same every time. But How I can it changeable like this? I used custom field for this.

  1. The first click on a post it will be like this, http://www.appsapk.mobi/whatsapp-messenger/

  2. After reading the post and review if they click the download button it needs to be like this, http://www.appsapk.mobi/whatsapp-messenger/platform/

  3. Again click one of the button it will be like this, http://www.appsapk.mobi/whatsapp-messenger/platform/android

                                <script type="text/Javascript">
                                    function update_url(url) {
                                        history.pushState(null, '', url);
                                    }
    
                                    function download_btn_press() {
                                        document.getElementById("download-1").style.display = "none";
                                        document.getElementById("download-2").style.display = "block";
                                        document.getElementById("block-1").style.display = "none";
                                        document.getElementById("block-2").style.display = "none";
                                        document.getElementById("block-3").style.display = "none";
                                        document.getElementById("block-4").style.display = "none";
                                        document.getElementById("block-5").style.display = "none";
                                        document.getElementById("recent-review").style.display = "none";
                                    }
    
                                    function download_android_press() {
                                        document.getElementById("download-1").style.display = "none";
                                        document.getElementById("download-2").style.display = "none";
                                        document.getElementById("download-3").style.display = "block";
                                        document.getElementById("block-1").style.display = "none";
                                        document.getElementById("block-2").style.display = "none";
                                        document.getElementById("block-3").style.display = "none";
                                        document.getElementById("block-4").style.display = "none";
                                        document.getElementById("block-5").style.display = "none";
                                        document.getElementById("recent-review").style.display = "none";
    
                                    }
    
                                    function back_two() {
                                        document.getElementById("download-3").style.display = "none";
                                        document.getElementById("download-2").style.display = "block";
                                        document.getElementById("block-1").style.display = "none";
                                        document.getElementById("block-2").style.display = "none";
                                        document.getElementById("block-3").style.display = "none";
                                        document.getElementById("block-4").style.display = "none";
                                        document.getElementById("block-5").style.display = "none";
                                        document.getElementById("download-1").style.display = "none";
                                        document.getElementById("recent-review").style.display = "none";
                                    }
    
                                    function back_one() {
                                        document.getElementById("download-3").style.display = "none";
                                        document.getElementById("download-2").style.display = "none";
                                        document.getElementById("download-1").style.display = "block";
                                        document.getElementById("block-1").style.display = "block";
                                        document.getElementById("block-2").style.display = "block";
                                        document.getElementById("block-3").style.display = "block";
                                        document.getElementById("block-4").style.display = "block";
                                        document.getElementById("block-5").style.display = "block";
                                    }
    
                                    function reviews_show() {
                                        document.getElementById("home").style.display = "none";
                                        document.getElementById("reviews").style.display = "block";
                                    }
    
                                    function home_show() {
                                        document.getElementById("home").style.display = "block";
                                        document.getElementById("reviews").style.display = "none";
                                    }
                                </script>
                                <?php
    
                                    if(isset($_POST['download'])) {
                                        echo '<script type="text/Javascript"> window.onload = function() {download_btn_press()}; </script>';
                                    }
    
                                    if(isset($_POST['android-download'])) {
                                        echo '<script type="text/Javascript"> window.onload = function() {download_android_press();}; </script>';
                                    }
    
                                    if(isset($_POST['back-one'])) {
                                        echo '<script type="text/Javascript"> window.onload = function() { back_one(); }; </script>';
                                    }
    
                                    if(isset($_POST['back-two'])) {
                                        echo '<script type="text/Javascript"> window.onload = function() { back_two(); }; </script>';
                                    }
    
                                ?>
                                <section class="inner-banner cate-view-inner">
                                      <div class="container">
                                     <div class="row">
                                         <div class="col-lg-5">
                                     <h1><?php the_title(); ?></h1>
                                    <p><a href="<?php echo get_home_url(); ?>">Home  &nbsp; // </a> <span><?php the_title(); ?></span></p>
                                         </div>
    
                                        <div class="col-lg-7">
                                         <div class="searc"> <input placeholder="Search your favorite tutorials..." type="search"> <input type="button"> </div>    
                                         </div>
    
                                          </div>
                                          </div>
                                      </section>
                                 <div class="container">
                                 <div class="row"> 
    
                                   <!--DIV Parent of Total Blocks in inner page Start-->
                                    <div class="parentDIV"> 
                                      <div class="col-lg-12">
                                      <div class="hotel-slder" id="block-1">
                                     <div class="hotel-full-view" id="block-2">
                                     <?php 
                                        if ( has_post_thumbnail() ) {
                                        the_post_thumbnail();
                                        } 
                                     ?>
                                <h2 class="book-mark"><?php the_title(); ?>
                                 </h2>
    
                                    <?php 
    
                                         $stars = ic_get_reviews_average(get_the_ID());
                                         if ($stars == 0) {
                                             echo '<span>Average Rating: <i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars > 0 && $stars < 1) {
                                             echo '<span>Average Rating: <i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars == 1) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars > 1 && $stars < 2) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars == 2) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars > 2 && $stars < 3) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars == 3) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars > 3 && $stars < 4) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars == 4) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars > 4 && $stars < 5) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         } elseif ($stars == 5) {
                                             echo '<span>Average Rating: <i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><span class="badge">'.$stars.'</span></span>';
                                         }
    
                                    ?>
                                    <p>Download Latest 2018 Version App for Mobile</p>
    
    
                                <div class="share">
                                    <!-- AddToAny BEGIN -->
                                <ul>
                                    <div class="a2a_kit a2a_kit_size_32 a2a_default_style">
                                        <li class="wonder">Wonderful!</li>
                                        <li><a class="a2a_button_facebook"></a></li>
                                        <li><a class="a2a_button_twitter"></a></li>
                                        <li><a class="a2a_button_google_plus"></a></li>
                                        <li><a class="a2a_dd" href="https://www.addtoany.com/share"></a></li>
                                    </div>  
                                </ul>
                                <script async src="https://static.addtoany.com/menu/page.js"></script>
                                <!-- AddToAny END -->
                                </div>
    
                                </div>
    
                                     </div>
    
                                <div class="hotel-add" id="block-3">
                                <!-- Single Page Adsense Ad Code -->
    
                                </div>
    
                                   <!-- /clearfix -->  
    
                                 </div>
                                 <br />
                                 <div class="col-lg-8">
                                      <div class='full-des' style='margin-bottom: 10px; padding: 25px' id='recent-review'>
                                        <?php
                                            $args = array(
                                            'number' => '1',
                                                'post_id' => $post->ID
                                            );
                                            $comments = get_comments($args);
                                            if($comments) {
                                                echo '<h2>Recent Review</h4><hr>';
                                            foreach($comments as $comment) :
                                                    echo '<h4>'.get_comment_meta($comment->comment_ID,'ic_review_title',true).'</h4>';
                                                    display_stars(get_comment_meta($comment->comment_ID,'ic_review_rating',true));
                                                    echo '<br>Posted By: <b>'.$comment->comment_author.'<br />'.$comment->meta_key.'</h4></b>';
                                                    echo '<br>" '.$comment->comment_content.' "<hr>';
                                                endforeach;
                                            } else {
                                                echo '<h2>Recent Review</h2><hr>';
                                                echo '<br /><p>No Recent Reviews found!</p>';
                                            }
                                        ?>
                                 </div>
                                 <div class="full-des">
                                 <!-- Nav tabs -->
                                  <ul class="nav nav-tabs hotel-tabs" role="tablist" id="block-4">
                                    <li role="presentation" class="active"><a href="#home" onclick="home_show()" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-align-left"></i> Summary</a></li>
    
                                    <li role="presentation"><a href="#reviews" onclick="reviews_show()" aria-controls="reviews" role="tab" data-toggle="tab"><i class="fas fa-chart-area"></i> Reviews</a></li>
                                  </ul>
    
                                  <!-- Tab panes -->
                                    <div class="tab-content">
                                    <div role="tabpanel" class="tab-pane active" id="home"> 
                                    <div class="summery">
                                    <div id="block-5">
                                        <?php echo the_content();?> 
                                        <br /><br />
                                    </div>
    
                                    <div class="download-section">
                                            <div class="row">
                                                <div class="col-lg-12">
                                                    <div class="row">
                                                        <div class="col-lg-2">
                                                            <div class="app-image">
                                                                <?php 
                                                                    if ( has_post_thumbnail() ) {
                                                                        the_post_thumbnail();
                                                                    } 
                                                                ?>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-10">
                                                            <h2 class="book-mark"><?php the_title(); ?></h2>
                                                        </div>
    
                                                    </div>
    
                                                    <div class="row" id="download-1">
                                                        <div class="col-lg-6">
                                                        <form method="POST" action="">
                                                            <input type="hidden" name="download"/>
                                                            <button type="submit" class="app-download"><i class="fas fa-chevron-down"></i> Download</button>
                                                        </form>
                                                        </div>
                                                        <div class="col-lg-6">
                                                            <button type="button" class="btn btn-default">
                                                                <i class="fab fa-android fa-2x"></i>
                                                            </button>
                                                            <button type="button" class="btn btn-default">
                                                                <i class="fab fa-apple fa-2x"></i>
                                                            </button>
                                                        </div>
                                                    </div>
    
                                                    <div class="row" id="download-2" style="display: none;">
                    <div class='row' id='sub-block-1'>
                        <div class="col-lg-12">
                            <p class="text-center">
                                <i class="fas fa-info-circle"></i> Pick your platform to download
                            </p>
                        </div>
                    </div>
                    <div class='row'>
                        <div class="col-lg-4">
                            <img src="" alt="Your Ad Goes Here!" style="width: 100%;"/>
                        </div>
                        <div class="col-lg-8" style="text-align: center;">
    
                            <form action="" method="POST">
                                <input type="hidden" name="android-download"/>
                                <button type="submit" class="btn btn-default app-download" style="width: 90%; margin: 5%;">
                                    <i class="fab fa-android"></i> Download for Android
                                </button>
                            </form>
    
                            <br />
                            <?php
                                echo "<a href='".get_field('ios_download_link')."' alt='' target='_blank'>";
                            ?>
                                <button type="button" class="btn btn-default app-download" style="width: 90%; margin: 5%;">
                                    <i class="fab fa-apple"></i> Download for iOS
                                </button>
                            </a>
    
                            <form action="" method="POST">
                                <input type="hidden" name="back-one"/>
                                <button type="submit" class="btn btn-default btn-back" name="back-one">
                                    <i class="fas fa-chevron-circle-left fa-2x back"></i>
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
    
                <div class="row" id="download-3" style="display: none;">
                    <div class="col-lg-12" style="text-align: center;">
                        <p>
                            <i class="fas fa-info-circle"></i> Download Now
                        </p>
                        <?php
                            echo "<a href='".get_field('android_download_link')."' alt='' target='_blank'>";
                        ?>
                            <button type="button" class="btn btn-default app-download" style="width: 90%; margin: 5%;">
                                <i class="fab fa-android"></i> Click to Download
                            </button>
                        </a>
    
                        <form action="" method="POST">
                            <input type="hidden" name="back-two"/>
                            <button type="submit" class="btn btn-default btn-back" name="back-two">
                                <i class="fas fa-chevron-circle-left fa-2x back"></i>
                            </button>
                        </form>
    
                    </div>
                </div>
    
                <div class="row">
                    <div class="col-lg-12">
                        <h5>
                            <b>Price:</b> Free
                        </h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-6">
                        <div class="rating">
                            <h3>
                                Average User Rating
                            </h3>
                            <?php
                                $stars = ic_get_reviews_average(get_the_ID());
    
                                if ($stars == 0) {
                                    echo '<span><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars > 0 && $stars < 1) {
                                    echo '<span><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars == 1) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars > 1 && $stars < 2) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars == 2) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars > 2 && $stars < 3) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars == 3) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars > 3 && $stars < 4) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars == 4) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="far fa-star yellow"></i></span>';
                                } elseif ($stars > 4 && $stars < 5) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star-half yellow"></i></span>';
                                } elseif ($stars == 5) {
                                    echo '<span><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i><i class="fas fa-star yellow"></i></span>';
                                                                    }
                                                                ?>
                                                                <?php
                                                                    $totals = ic_get_product_review_totals(get_the_ID());
    
                                                                    echo '<p>'.$totals['total'].' Votes</p>';
                                                                ?>
                                                            </div>
                                                        </div>
                                                        <div class="col-lg-6">
                                                            <div class="list">
                                                                Uninstall the app
                                                                <ol>
                                                                    <li>Go to Settings menu.</li>
                                                                    <li>Choose Apps or Application Manager.</li>
                                                                    <li>Touch the app you want to remove.</li>
                                                                    <li>Press Uninstall.</li>
                                                                </ol>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                 </div>
                                </div>
    
    
                                <div role="tabpanel" class="tab-pane reviews-view" id="reviews" style="display: none; transition: 0.5s ease-in-out;"> 
                                  <div class="rati">
    
                                  </div>
    
    
                                <div class="right-side-doctors-list room-list">
    
                                </div>
    
                                <div class="sr">
                                   <?php ic_reviews(); ?>
                                    <!-- <div class="btn system-bnt pull-right"><a href="#">Submit Your Review</a></div> -->
    
                                 </div>
                                    </div>
    
                                 </div>
                                    </div>
    
                                     <!--Right Side Doctors List End--> 
    
                                  <?php get_sidebar(); ?>
                                      </div>
    

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.