Forum Replies Created

Viewing 15 replies - 61 through 75 (of 88 total)
  • Forum: Fixing WordPress
    In reply to: Paginate on pages?

    Hi

    I have checked the url but seems to the page https://otaku.bg/?page_id=31 redirecting to a contact page.Could you please address exact page you want the pagination ?

    Regards!

    Forum: Fixing WordPress
    In reply to: Posts

    Hi

    Do one thing just copy the content from the doc and paste it into a normal text file(.txt) and again copy the content from text file to wordpress editor and save it . And check again ?

    Regards
    Sumith !

    Great work ??

    Ok please try the code i have modified for you.

    add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
    
    function add_loginout_link( $items, $args ) {
          global $current_user;
          get_currentuserinfo();
    
       if (is_user_logged_in()) {
            $account_fname = $current_user->user_firstname;
             $account_lname = $current_user->user_lastname;
            $account_text=$account_fname." ".$account_lname;
            $user_id=$current_user->ID;
    	$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' ); 
            $edit_profile_url = get_edit_profile_url( $user_id, $scheme );
    	$logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) ); 
            $items .= '<li><a href="'.get_permalink( get_option('woocommerce_myaccount_page_id') ).'">'.$account_text.'</a>
    	   <ul class="submenu"><li><a href="'.get_permalink( get_option('woocommerce_myaccount_page_id') ).'">Edit Profile</a></li><li><a href="'. $logout_url  .'">Log Out</a></li></ul></li>';
    
       }
    
       elseif (!is_user_logged_in()) {
    
           $items .= '<li><a class="popup-login" href="#">Log In</a></li><li><a class="popup-register" href="#">Register</a></li>';
    
       }
    
       return $items;
    
    }
    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    Sorry admin my intention wast to help him to solve the issue. I wont repeat it ??

    Ok .It seems to be you need more control over account menus . So it would be better split the wp_nav_menu and the account menus separate in header HTML. Will you able to do that ? Also need some coding to work like that.

    We can kill all of the problems ??

    Best of Luck ??

    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    You can increase the maximum upload size in WordPress. Open or create the .htaccess file in the root folder and add the following code. Please change the values accordingly

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300

    Please try and let me know its working or not ??

    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    ??

    Ok please try the modified code . And let me know if you need more help on the same 1

    function add_last_nav_item($items) {
    	if ( ! is_user_logged_in() ) {   
    	  return $items .= "<li><a href='#' class='popup-login'>Login via popup</a></li>";
    	} else{
    	return $items;
    	}
    }
    add_filter('wp_nav_menu_items','add_last_nav_item');

    Regards
    Sumith

    May be have missed the li tag. Please change the code accordingly. Or you have specific class for the a tag please apply the same class to the a tag.

    function add_last_nav_item($items) {
      return $items .= "<li><a href='#' class='popup-login'>Login via popup</a></li>";
    }
    add_filter('wp_nav_menu_items','add_last_nav_item');

    Regards
    Sumith

    • This reply was modified 7 years, 5 months ago by sumithsuku11.
    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    Could you please address your site link here ?

    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    Please user a header location inside the code to clear the $_POST.

       $current_url="https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	   header('Location: '.$current_url);

    Here the complete code

    <?php
    	$postTitleError = '';
    	$postcontentError = '';
    	
    	if ( isset( $_POST['submitted'] ) && isset( $_POST['post_nonce_field'] ) && wp_verify_nonce( $_POST['post_nonce_field'], 'post_nonce' ) ) {
    	  if (trim($_POST['postTitle']) === '' || $_POST['postContent'] === '' ) {
    	    if(trim($_POST['postTitle']) === '') {
    	      $postTitleError = 'Please enter a title.';
    	    }
    	    if(trim($_POST['postContent']) === '') {
    	      $postcontentError = 'Please enter a title.';
    	    }
    	  }
    	  else {
    	    $post_information = array(
    	      'post_title' => esc_attr(strip_tags($_POST['postTitle'])),
    	      'post_content' => esc_attr(strip_tags($_POST['postContent'])),
    	      'post_status' => 'publish',           // Choose: publish, preview, future, pending, draft, etc.
    	      'post_type' => 'post'
    	    );
    	    $post_id = wp_insert_post($post_information);
    
    	    ?>
    	    <?php
    	  }
           $current_url="https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    	   header('Location: '.$current_url);
    	  
    	}
    	
    
    	?>
    
    	<div class="col-xs-12">
    	  <form action="" id="primaryPostForm" method="POST" enctype="multipart/form-data">
    	    <div class="form-group">
    	      <!--<label for="postTitle"><?php _e('Nome:', 'framework') ?></label>!-->
    	      <input type="hidden" class="form-control" autocomplete="off" name="postTitle" id="postTitle" value="" placeholder="Nome:" required />
    	    </div>
    	    <?php if($postTitleError != '') { ?>
    	      <span class="error"><?php echo $postTitleError; ?></span>
    	      <div class="clearfix"></div>
    	    <?php } ?>
    
    	    <div class="form-group">
    	      <!--<label for="postContent"><?php _e('Mensagem:', 'framework') ?></label>!-->
    	      <textarea name="postContent" class="form-control" autocomplete="off" rows="4" placeholder="Mensagem..." ></textarea>
    	    </div>
    	    <?php if($postcontentError != '') { ?>
    	      <span class="error"><?php echo $postcontentError; ?></span>
    	      <div class="clearfix"></div>
    	    <?php } ?>
    
    	    <div class="form-group">
    	      <?php wp_nonce_field('post_nonce', 'post_nonce_field'); ?>
    	      <input type="hidden" name="submitted" id="submitted" value="true" />
    	      <button type="submit" class="btn btn-primary btn-lg btn-block"><?php _e('Enviar', 'framework') ?></button>
    	    </div>
    	  </form>
    	</div>

    Hii , you can use jquery to add a menu item in the wp_nav_menu.

    
            $( document ).ready(function() {
                $(".main-menu ul").append("<a href='#' class='popup-login'>Login via popup</a>");
            });

    (Pleasechange the menu(.main-menu ul) reference class according to your Site)

    Or you can use wordpress wp_nav_menu_items hook.

    function add_last_nav_item($items) {
      return $items .= "<a href='#' class='popup-login'>Login via popup</a>";
    }
    add_filter('wp_nav_menu_items','add_last_nav_item');
    • This reply was modified 7 years, 5 months ago by sumithsuku11.

    Have you add any codes inside the wp-config.php file or any extra space ? Please check it also.

    • This reply was modified 7 years, 5 months ago by sumithsuku11.
Viewing 15 replies - 61 through 75 (of 88 total)