Hi Rahul, Thanks for the prompt reply. I am talking about the main menu in wordpress on left hand side, The “project” option in wordpress menu is from my theme template. The “project” option is just above the “post” option in left side menu in wordpress. Farhan
I’d posted code https://wordpress.org/support/topic/duplicated-title-1?replies=9 Also im unable to change theme http://share-ask.com/question/question so it looks weird
Hi @peter and @Fred, get the latest version from github. I have added a new constant: ANSPRESS_USER_PROFILE_URL and you can directly add user profile link from menu editor. I want to let you know that in upcoming version there will be direct link to user profiles. like: http://mydomain.com/user/rahul and same for other permalinks: for question: http://mydomain.com/question-title/ for list: http://mydomain.com/YOUR-BASE-PAGE
Hi techgopal ! For a normal user and from my experience, “subscriber” will work just fine. So don’t worry about changing their role. 😀 For ranks, just decide the default rank for newly registered user in Asnpress > Options > User. Even if you already have a lot of registered users, they will be assigned that rank when they first interact with Anspress features… at least it’s what I saw. 😉
Hi @Peter! You might be looking for a more technical answer but here is a little trick that I found. This simple url is showing the logged in user profile : http://anspress.io/questions/user/ (click to check your Open-WP profile). 😉 As long as you respect the url structure (http://mydomain.com/anspress-path/user/), it can work on any site. I use it in a conditional menu item, so that it only shows up when someone is logged in. Pro – super easy to implement without any technical knowledge : you just add this link in a menu item ! 😎 Con – it is not actually redirecting to the user profile page, so the user won’t be able to get his REAL profile url (for sharing for instance) Don’t know if it will help. For a more technical insight, try to search for “profile link” : there is already a few threads with some answers. 😉
if rank & user role are two different things so by default which role should be assigned to users to work perfectly. subscriber role will work ??
Array ( [width] => 5705 [height] => 3803 [file] => 40H.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => 40H-150×99.jpg [width] => 150 [height] => 99 [mime-type] => image/jpeg ) [medium] => Array ( [file] => 40H-300×199.jpg [width] => 300 [height] => 199 [mime-type] => image/jpeg ) [large] => Array ( [file] => 40H-1024×682.jpg [width] => 1024 [height] => 682 [mime-type] => image/jpeg ) [ap_cover] => Array ( [file] => 40H-878×200.jpg [width] => 878 [height] => 200 [mime-type] => image/jpeg ) [ap_cover_small] => Array ( [file] => 40H-275×200.jpg [width] => 275 [height] => 200 [mime-type] => image/jpeg ) [et-pb-post-main-image] => Array ( [file] => 40H-400×250.jpg [width] => 400 [height] => 250 [mime-type] => image/jpeg ) [et-pb-post-main-image-fullwidth] => Array ( [file] => 40H-1080×675.jpg [width] => 1080 [height] => 675 [mime-type] => image/jpeg ) [et-pb-portfolio-image] => Array ( [file] => 40H-400×284.jpg [width] => 400 [height] => 284 [mime-type] => image/jpeg ) [et-pb-portfolio-image-single] => Array ( [file] => 40H-1080×719.jpg [width] => 1080 [height] => 719 [mime-type] => image/jpeg ) ) [image_meta] => Array ( [aperture] => 0 [credit] => [camera] => => [created_timestamp] => 0 [copyright] => [focal_length] => 0 [iso] => 0 [shutter_speed] => 0 [title] => [orientation] => 1 ) )
I need some info to solve this issue, simply paste this function in your theme function.php: print_r(wp_get_attachment_metadata( $attachment_id )); replace $attachment_id with an id of attachment (wp-admin->media). and show us the result.
@AcidRaZar, I don’t know if it will be any useful to you, but this is my updated script to import Question and Answer from my external Q&A database. Since my Q&A database is linear (same row contains a question and its answer column contains the answer) unlike Q2A database structure (which is question in one row, then answers in another multiple rows linked to parent question row; defined by type of row – either a question/answer/comment). So, you need to edit code at some relevant places, such as loop until you get all answers of a particular question. (edit according to Q2A database). It will hardly take 1 or 2 days to make your own (raw) import – script, hard-coded for your database only. Note – 1. Let Rahul comment on any missing answers-meta, as I don’t know about them. <?php // replace your connection settings $db = @mysql_connect('localhost', 'root', 'password') or die(mysql_error()); mysql_select_db('database_name', $db) or die(mysql_error()); $qry_qbank = mysql_query("SELECT * FROM table_name limit 100") or die(mysql_error()); require('wp-blog-header.php'); define('ANSPRESS_VOTE_META', '_ap_vote'); define('ANSPRESS_FAV_META', '_ap_favorite'); define('ANSPRESS_CLOSE_META', '_ap_close'); define('ANSPRESS_FLAG_META', '_ap_flag'); define('ANSPRESS_VIEW_META', '_views'); define('ANSPRESS_UPDATED_META', '_ap_updated'); define('ANSPRESS_ANS_META', '_ap_answers'); define('ANSPRESS_SELECTED_META', '_ap_selected'); define('ANSPRESS_BEST_META', '_ap_best_answer'); define('ANSPRESS_PARTI_META', '_ap_participants'); define('AP_FOLLOWERS_META', '_ap_followers'); define('AP_FOLLOWING_META', '_ap_following'); while($row = mysql_fetch_array( $qry_qbank )) { $qno = $row['id']; $question_title = $row['Question_Title']; $question_content = $row['Question_Content']; $answer_content = $row['Answer_Content'];; $category = array(12, 13, 15); $tags = array(21, 22, 23); $user_id = 1; $status = 'publish'; $question_array = array( 'post_title' => $question_title, 'post_author' => $user_id, 'post_content' => wp_kses($question_content, ap_form_allowed_tags()), 'post_type' => 'question', 'post_status' => $status ); $question_post_id = wp_insert_post($question_array); if […]