qid int64 4 8.14M | question stringlengths 20 48.3k | answers list | date stringlengths 10 10 | metadata list | input stringlengths 12 45k | output stringlengths 2 31.8k |
|---|---|---|---|---|---|---|
411,774 | <p>Where is my mistake?
html code</p>
<pre><code><div class="star-rating">
<span class="postid" post-id="52"></span>
<span class="score-bg"></span>
<div class="scores">
<?php for ($i = 1; $i <= 5; $i++): ?>
<div class="score" data-score="<?php echo $i; ?>">
<span class="scoreAbsolute"></span>
</div>
<?php endfor; ?>
</div>
</code></pre>
<pre><code>jQuery(document).ready(function ($) {
$(function () {
$(".score").click(function () {
var score = $(this).attr('data-score');
var post = $('.postid').attr('post-id');
$.ajax({
url: post_score.ajaxscript,
method: 'POST',
data: {
'action': 'submit_score',
'postid': post,
'postScore': score,
},
success: function (data) {
console.log(data);
}, error: function (errorThrown) {
alert('nok');
}
});
});
});
</code></pre>
<p>});</p>
<p>php code</p>
<pre class="lang-php prettyprint-override"><code> add_action('wp_ajax_submit_score', 'submit_score');
add_action('wp_ajax_nopriv_submit_score', 'submit_score');
function submit_score()
{
if (isset($_POST['action'])) {
//something
}
wp_die();
}
</code></pre>
| [
{
"answer_id": 411659,
"author": "Scriptile",
"author_id": 125086,
"author_profile": "https://wordpress.stackexchange.com/users/125086",
"pm_score": 1,
"selected": true,
"text": "<p>Ok, so I had 5.5 version of wordpress and it was Incompatible with 8 PHP (on new server) so I updated Word... | 2022/12/02 | [
"https://wordpress.stackexchange.com/questions/411774",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/107899/"
] | Where is my mistake?
html code
```
<div class="star-rating">
<span class="postid" post-id="52"></span>
<span class="score-bg"></span>
<div class="scores">
<?php for ($i = 1; $i <= 5; $i++): ?>
<div class="score" data-score="<?php echo $i; ?>">
<span class="scoreAbsolute"></span>
</div>
<?php endfor; ?>
</div>
```
```
jQuery(document).ready(function ($) {
$(function () {
$(".score").click(function () {
var score = $(this).attr('data-score');
var post = $('.postid').attr('post-id');
$.ajax({
url: post_score.ajaxscript,
method: 'POST',
data: {
'action': 'submit_score',
'postid': post,
'postScore': score,
},
success: function (data) {
console.log(data);
}, error: function (errorThrown) {
alert('nok');
}
});
});
});
```
});
php code
```php
add_action('wp_ajax_submit_score', 'submit_score');
add_action('wp_ajax_nopriv_submit_score', 'submit_score');
function submit_score()
{
if (isset($_POST['action'])) {
//something
}
wp_die();
}
``` | Ok, so I had 5.5 version of wordpress and it was Incompatible with 8 PHP (on new server) so I updated Wordpress to 6.1 and it worked. |
411,800 | <p>When someone logs into the wordpress dashboard I want the Pro version of my plugin to check for the latest version of itself on a remote (my) server. All it retrieves is the most recent version number.</p>
<pre><code>function plugin_version_check() {
global $latestversion
$latestversion = (something);
return $latestversion;
}
do_action('wp_login', 'plugin_version_check');
</code></pre>
<p>so far so good, it works.</p>
<p>Then I would expect the value of $latestversion to be available elsewhere, but it isn't</p>
<pre><code>function dk_plugin_meta_links( $links, $file ) {
//use the value of $latestversion here
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
</code></pre>
<p>Without success I have also tried</p>
<pre><code>function dk_plugin_meta_links( $links, $file, $latestversion ) {
</code></pre>
<p>(including changing the accepted args to 3)</p>
<p>which I would expect to work since $latestversion is a global variable, right?</p>
<p>Looking for solutions I have gone in circles and gotten ridiculously confused. How do I do this?</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/03 | [
"https://wordpress.stackexchange.com/questions/411800",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/25717/"
] | When someone logs into the wordpress dashboard I want the Pro version of my plugin to check for the latest version of itself on a remote (my) server. All it retrieves is the most recent version number.
```
function plugin_version_check() {
global $latestversion
$latestversion = (something);
return $latestversion;
}
do_action('wp_login', 'plugin_version_check');
```
so far so good, it works.
Then I would expect the value of $latestversion to be available elsewhere, but it isn't
```
function dk_plugin_meta_links( $links, $file ) {
//use the value of $latestversion here
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
```
Without success I have also tried
```
function dk_plugin_meta_links( $links, $file, $latestversion ) {
```
(including changing the accepted args to 3)
which I would expect to work since $latestversion is a global variable, right?
Looking for solutions I have gone in circles and gotten ridiculously confused. How do I do this? | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
411,870 | <p>It seems like the only thing you can put inside a list item is text (including links), inline images, and lists. But I would like to insert a whole group of blocks inside a list item.</p>
<p>I was able to do it by switching to the code editor but then when I go back to the visual editor I get errors (<em>This block contains unexpected or invalid content</em>). Besides the error, it displays properly but doesn't allow modifications.</p>
<p>I have a lot of things to add to this page and HTML isn't going to cut it. Besides using HTML, is there a way to make it work? I'm thinking a group with a CSS class that makes it display an item number or bullet. Not sure how to to achieve that but I'm open to your input.</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/06 | [
"https://wordpress.stackexchange.com/questions/411870",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228082/"
] | It seems like the only thing you can put inside a list item is text (including links), inline images, and lists. But I would like to insert a whole group of blocks inside a list item.
I was able to do it by switching to the code editor but then when I go back to the visual editor I get errors (*This block contains unexpected or invalid content*). Besides the error, it displays properly but doesn't allow modifications.
I have a lot of things to add to this page and HTML isn't going to cut it. Besides using HTML, is there a way to make it work? I'm thinking a group with a CSS class that makes it display an item number or bullet. Not sure how to to achieve that but I'm open to your input. | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
411,909 | <p>Is it possible to hide a specific dynamically created div from user that is logged out?</p>
<p>I have tried this but doesnt work:</p>
<pre><code><?php if (is_user_logged_in()): ?>
var element = document.getElementById("elementor-element-f4e5a8e");
element.classList.add("logged-in");
<?php else: ?>
var element = document.getElementById("elementor-element-f4e5a8e");
element.classList.remove("logged-out");
<?php endif; ?>
</code></pre>
<p>Then added the appropriate css.</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/07 | [
"https://wordpress.stackexchange.com/questions/411909",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/219842/"
] | Is it possible to hide a specific dynamically created div from user that is logged out?
I have tried this but doesnt work:
```
<?php if (is_user_logged_in()): ?>
var element = document.getElementById("elementor-element-f4e5a8e");
element.classList.add("logged-in");
<?php else: ?>
var element = document.getElementById("elementor-element-f4e5a8e");
element.classList.remove("logged-out");
<?php endif; ?>
```
Then added the appropriate css. | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
411,922 | <p>I'm trying to upload a plugin (it's not available in the marketplace), that's 2.73 megabytes, but the limit is 2M. I've increased the <code>max_upload_filesize</code> variable in php.ini to 3M, but still can't upload because of the size.</p>
<p>I don't see a filesize set in <code>.htaccess</code>, and in the <code>functions.php</code> file it's set to 64M.</p>
<p>Where else can I check, that would have a max upload size that may be overriding the values mentioned above?</p>
<p>Thanks!</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/07 | [
"https://wordpress.stackexchange.com/questions/411922",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/123563/"
] | I'm trying to upload a plugin (it's not available in the marketplace), that's 2.73 megabytes, but the limit is 2M. I've increased the `max_upload_filesize` variable in php.ini to 3M, but still can't upload because of the size.
I don't see a filesize set in `.htaccess`, and in the `functions.php` file it's set to 64M.
Where else can I check, that would have a max upload size that may be overriding the values mentioned above?
Thanks! | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
411,951 | <p>In my plugin settings I got the custom post type set in variable $clientlogocptname</p>
<p>$clientlogocptname = get_option( 'clientlogocpt-select' );</p>
<p>How do I retrive the value of $clientlogocptname setting and pass it in getEntityRecords in "custompost_type" gutenberg block?? Is it possible to get the value in the block or can you suggest a better way?</p>
<pre><code>const data = useSelect((select) => {
return select('core').getEntityRecords('postType', 'custompost_type');
});
</code></pre>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/08 | [
"https://wordpress.stackexchange.com/questions/411951",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/192926/"
] | In my plugin settings I got the custom post type set in variable $clientlogocptname
$clientlogocptname = get\_option( 'clientlogocpt-select' );
How do I retrive the value of $clientlogocptname setting and pass it in getEntityRecords in "custompost\_type" gutenberg block?? Is it possible to get the value in the block or can you suggest a better way?
```
const data = useSelect((select) => {
return select('core').getEntityRecords('postType', 'custompost_type');
});
``` | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
412,053 | <p>Hello I am building simple plugin and i want to make a chart, I have used chartjs. Its displaying static data, I want label datewise. Example today 13-12-2022, So the lebel should start from 06-12-2022. Bellow my code that i am trying but not getting all dates into label in chartjs.</p>
<pre><code>$posts = get_posts( [ 'post_type' => 'docs', 'date_query' => array( array( 'after' => '1 week ago', 'inclusive' => true))] );
$docs_num = count( $posts );
$labels = [];
$dataCount = [];
foreach ( $posts as $item ) {
$labels[] = date('d M, Y', strtotime($item->post_date));
$dataCount[] = get_post_meta( $item->ID, 'post_views_count', false );
}
</code></pre>
<p>Here is my chartjs code:</p>
<pre><code>var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['07 Dec 2022', '08 Dec 2022', '09 Dec 2022', '10 Dec 2022', '11 Dec 2022', '12 Dec 2022', '13 Dec 2022'],
datasets: [
{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
},
{
label: 'My Second dataset',
backgroundColor: 'rgb(255, 43, 122)',
borderColor: 'rgb(255, 45, 122)',
data: [0, 20, 3, 4, 30, 40, 41]
}
]
},
// Configuration options go here
options: {}
});
</code></pre>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/13 | [
"https://wordpress.stackexchange.com/questions/412053",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/217851/"
] | Hello I am building simple plugin and i want to make a chart, I have used chartjs. Its displaying static data, I want label datewise. Example today 13-12-2022, So the lebel should start from 06-12-2022. Bellow my code that i am trying but not getting all dates into label in chartjs.
```
$posts = get_posts( [ 'post_type' => 'docs', 'date_query' => array( array( 'after' => '1 week ago', 'inclusive' => true))] );
$docs_num = count( $posts );
$labels = [];
$dataCount = [];
foreach ( $posts as $item ) {
$labels[] = date('d M, Y', strtotime($item->post_date));
$dataCount[] = get_post_meta( $item->ID, 'post_views_count', false );
}
```
Here is my chartjs code:
```
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['07 Dec 2022', '08 Dec 2022', '09 Dec 2022', '10 Dec 2022', '11 Dec 2022', '12 Dec 2022', '13 Dec 2022'],
datasets: [
{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
},
{
label: 'My Second dataset',
backgroundColor: 'rgb(255, 43, 122)',
borderColor: 'rgb(255, 45, 122)',
data: [0, 20, 3, 4, 30, 40, 41]
}
]
},
// Configuration options go here
options: {}
});
``` | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
412,100 | <p>How we can enqueue a stylesheet out of theme folder? Example: wp-content > cssfile.css</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/14 | [
"https://wordpress.stackexchange.com/questions/412100",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228315/"
] | How we can enqueue a stylesheet out of theme folder? Example: wp-content > cssfile.css | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
412,107 | <p>I'm having trouble getting consistent results from a WP_User_Query when ordering by multiple meta values.</p>
<p>There is a meta field that contains a serialized list of IDs, and I need to display users with a certain ID (72) first. These users need to be alphabetized by last name. The following users without this ID need to be alphabetized by last name as well.</p>
<p>The query works fine if I only look for users with the ID 72 and sort by last name. When I use the query below however, I get inconsistent last name sorting results. The ID 72 users always show up first, but certain users are inexplicably out of order.</p>
<p>Here's the gist of my query:</p>
<pre><code>$users = new WP_User_Query( array(
'meta_query' => array(
'relation' => 'AND',
'lastname' => array(
'key' => 'last_name',
'compare' => 'EXISTS',
'type' => 'CHAR',
),
'list' => array(
'distribution_list' => array(
'key' => 'distribution_list',
'value' => '"72"',
'compare' => 'LIKE'
),
'distribution_list2' => array(
'key' => 'distribution_list',
'value' => '"72"',
'compare' => 'NOT LIKE'
),
'relation' => 'OR',
),
)
'orderby' => array(
'distribution_list' => 'ASC',
'last_name' => 'ASC',
),
) );
</code></pre>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/14 | [
"https://wordpress.stackexchange.com/questions/412107",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228331/"
] | I'm having trouble getting consistent results from a WP\_User\_Query when ordering by multiple meta values.
There is a meta field that contains a serialized list of IDs, and I need to display users with a certain ID (72) first. These users need to be alphabetized by last name. The following users without this ID need to be alphabetized by last name as well.
The query works fine if I only look for users with the ID 72 and sort by last name. When I use the query below however, I get inconsistent last name sorting results. The ID 72 users always show up first, but certain users are inexplicably out of order.
Here's the gist of my query:
```
$users = new WP_User_Query( array(
'meta_query' => array(
'relation' => 'AND',
'lastname' => array(
'key' => 'last_name',
'compare' => 'EXISTS',
'type' => 'CHAR',
),
'list' => array(
'distribution_list' => array(
'key' => 'distribution_list',
'value' => '"72"',
'compare' => 'LIKE'
),
'distribution_list2' => array(
'key' => 'distribution_list',
'value' => '"72"',
'compare' => 'NOT LIKE'
),
'relation' => 'OR',
),
)
'orderby' => array(
'distribution_list' => 'ASC',
'last_name' => 'ASC',
),
) );
``` | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
412,112 | <p>If image location is <code>themefolder/image/image.jpg</code> then path will be <code>src="<?php echo get_template_directory_uri(); ?>/image/image.jpg"</code>.</p>
<p>But how do I give a path to an image in WordPress if its location is <code>wp-content/uploads/2022/12/image.jpg</code>?</p>
<p>NOTE: I am converting my website from HTML to WordPress.</p>
| [
{
"answer_id": 411802,
"author": "VX3",
"author_id": 228026,
"author_profile": "https://wordpress.stackexchange.com/users/228026",
"pm_score": -1,
"selected": false,
"text": "<p>In your code, the $latestversion variable is defined as a global variable inside the plugin_version_check func... | 2022/12/14 | [
"https://wordpress.stackexchange.com/questions/412112",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228315/"
] | If image location is `themefolder/image/image.jpg` then path will be `src="<?php echo get_template_directory_uri(); ?>/image/image.jpg"`.
But how do I give a path to an image in WordPress if its location is `wp-content/uploads/2022/12/image.jpg`?
NOTE: I am converting my website from HTML to WordPress. | The solution for this was a compromise
I moved the code from the `wp_login` hook into my meta\_links function and test to see if my value exists
```
function dk_plugin_meta_links( $links, $file ) {
if($latestversion == "") {
//get the latest version if we don't already have it
}
(do something with) $latestversion;
}
add_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );
``` |
412,176 | <p>I've been working on a staging site, installed to a subdomain with installatron. It appears that a good portion of this staging site has now been indexed and shows up when you search for our business. I've set up a error page with a link back to our public website, but have failed to make a 301 redirect work, with either a plugin or a cpanel redirect.</p>
<p>After more reading it looks like the correct answer is to put this code in the functions.php file of my staging sites child theme - but I would like someone to confirm that this will do what I'm hoping?</p>
<pre><code>add_action('wp_head', 'no_robots_wp_head');
function no_robots_wp_head(){
?>
<meta name="robots" content="noindex, nofollow" />
<?php
}
</code></pre>
<p>In theory I want this to get google to de-index all pages of subdomain.website.ca while keeping website.ca indexed as is.</p>
| [
{
"answer_id": 412193,
"author": "Fayaz",
"author_id": 110572,
"author_profile": "https://wordpress.stackexchange.com/users/110572",
"pm_score": 2,
"selected": true,
"text": "<h2>Use a Plugin</h2>\n<p>First of all, your CODE looks fine. However, it's better if you put that code in a smal... | 2022/12/17 | [
"https://wordpress.stackexchange.com/questions/412176",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228396/"
] | I've been working on a staging site, installed to a subdomain with installatron. It appears that a good portion of this staging site has now been indexed and shows up when you search for our business. I've set up a error page with a link back to our public website, but have failed to make a 301 redirect work, with either a plugin or a cpanel redirect.
After more reading it looks like the correct answer is to put this code in the functions.php file of my staging sites child theme - but I would like someone to confirm that this will do what I'm hoping?
```
add_action('wp_head', 'no_robots_wp_head');
function no_robots_wp_head(){
?>
<meta name="robots" content="noindex, nofollow" />
<?php
}
```
In theory I want this to get google to de-index all pages of subdomain.website.ca while keeping website.ca indexed as is. | Use a Plugin
------------
First of all, your CODE looks fine. However, it's better if you put that code in a small custom Plugin. That way, you can easily keep the plugin active on the development and staging sites and deactivate it on the main site.
Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.
Also, we should have debugging enabled on development and staging sites. Often it's done by having different `wp-config.php` files (excluded from Git) on development, staging and production sites.
You may even take advantage of that and set the following `true` on dev and staging, and false on production:
```
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
```
Then never set these to `true` on production, at least not `WP_DEBUG_DISPLAY`. This way, you can just use the plugin and forget it's even there. No further change is needed from staging to production unless you change `WP_DEBUG_DISPLAY` on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.
Here's how the plugin code would look like:
```
<?php
/*
Plugin Name: Custom No Index
Description: A plugin to add a noindex, nofollow meta tag to the head of every page.
Author: Fayaz Ahmed
Version: 1.0
*/
add_action( 'wp_head', 'no_index_on_debug' );
function no_index_on_debug() {
if( WP_DEBUG && WP_DEBUG_DISPLAY ) {
?>
<meta name="robots" content="noindex, nofollow" />
<?php
}
}
```
Use Google Search Console
-------------------------
Secondly, you may also use Google Search Console to expedite the process of de-indexing your staging site's pages. Here are the steps you can take:
1. Go to <https://search.google.com/search-console/> and sign in with your Google account.
2. Select the property (website) that represents your staging site from the list of properties.
3. From the left menu go to: `Indexing` → `Removals`, and in the `Temporary Removals` Tab, use the `NEW REQUEST` button to submit URLs for removal.
It may take some time for Google to process the request to remove the URLs from search results. You can also use the "URL inspection" tool in Search Console to check the status of your request and see if the URL has been removed from the search results. |
412,184 | <p>I have a list of events. I built a CPT “Evenements” for these Events.
I included these CPT in my rss feed using the following function</p>
<pre><code>add_filter( 'request', 'wpm_myfeed_request' );
function wpm_myfeed_request( $qv )
{
if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) )
{
// Ici on choisit quels customs posts types seront présents dans le flux RSS
$qv['post_type'] = array( 'post', 'Evenements' );
} return $qv;
}
</code></pre>
<p>So, My rss feed is made of a list of CPT.
Each entries links to a page as</p>
<p><a href="https://website.de/de/aktivitaeten/firmenbesichtigung/" rel="nofollow noreferrer">https://website.de/de/aktivitaeten/firmenbesichtigung/</a> Where “firmenbesichtigung » is the CPT title.</p>
<p>But I would like all RSS feed entries to link to the page <a href="https://website.de/de/aktivitaeten/" rel="nofollow noreferrer">https://website.de/de/aktivitaeten/</a></p>
<p>not the URL of the specific CPT (<a href="https://website.de/de/aktivitaeten/firmenbesichtigung/" rel="nofollow noreferrer">https://website.de/de/aktivitaeten/firmenbesichtigung/</a>)</p>
<p>Do you have an idea about this?
or How to have all RSS feed entries linking to the same specific page ?</p>
<p>Many many thanks for your help</p>
<p>Timama</p>
| [
{
"answer_id": 412193,
"author": "Fayaz",
"author_id": 110572,
"author_profile": "https://wordpress.stackexchange.com/users/110572",
"pm_score": 2,
"selected": true,
"text": "<h2>Use a Plugin</h2>\n<p>First of all, your CODE looks fine. However, it's better if you put that code in a smal... | 2022/12/17 | [
"https://wordpress.stackexchange.com/questions/412184",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/69774/"
] | I have a list of events. I built a CPT “Evenements” for these Events.
I included these CPT in my rss feed using the following function
```
add_filter( 'request', 'wpm_myfeed_request' );
function wpm_myfeed_request( $qv )
{
if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) )
{
// Ici on choisit quels customs posts types seront présents dans le flux RSS
$qv['post_type'] = array( 'post', 'Evenements' );
} return $qv;
}
```
So, My rss feed is made of a list of CPT.
Each entries links to a page as
<https://website.de/de/aktivitaeten/firmenbesichtigung/> Where “firmenbesichtigung » is the CPT title.
But I would like all RSS feed entries to link to the page <https://website.de/de/aktivitaeten/>
not the URL of the specific CPT (<https://website.de/de/aktivitaeten/firmenbesichtigung/>)
Do you have an idea about this?
or How to have all RSS feed entries linking to the same specific page ?
Many many thanks for your help
Timama | Use a Plugin
------------
First of all, your CODE looks fine. However, it's better if you put that code in a small custom Plugin. That way, you can easily keep the plugin active on the development and staging sites and deactivate it on the main site.
Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.
Also, we should have debugging enabled on development and staging sites. Often it's done by having different `wp-config.php` files (excluded from Git) on development, staging and production sites.
You may even take advantage of that and set the following `true` on dev and staging, and false on production:
```
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
```
Then never set these to `true` on production, at least not `WP_DEBUG_DISPLAY`. This way, you can just use the plugin and forget it's even there. No further change is needed from staging to production unless you change `WP_DEBUG_DISPLAY` on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.
Here's how the plugin code would look like:
```
<?php
/*
Plugin Name: Custom No Index
Description: A plugin to add a noindex, nofollow meta tag to the head of every page.
Author: Fayaz Ahmed
Version: 1.0
*/
add_action( 'wp_head', 'no_index_on_debug' );
function no_index_on_debug() {
if( WP_DEBUG && WP_DEBUG_DISPLAY ) {
?>
<meta name="robots" content="noindex, nofollow" />
<?php
}
}
```
Use Google Search Console
-------------------------
Secondly, you may also use Google Search Console to expedite the process of de-indexing your staging site's pages. Here are the steps you can take:
1. Go to <https://search.google.com/search-console/> and sign in with your Google account.
2. Select the property (website) that represents your staging site from the list of properties.
3. From the left menu go to: `Indexing` → `Removals`, and in the `Temporary Removals` Tab, use the `NEW REQUEST` button to submit URLs for removal.
It may take some time for Google to process the request to remove the URLs from search results. You can also use the "URL inspection" tool in Search Console to check the status of your request and see if the URL has been removed from the search results. |
412,190 | <p>I want to hide, let's say, example.com/services/washing ('Services' is the this is a custom post type) from the search engine and show a 401 error page. How do I?</p>
| [
{
"answer_id": 412193,
"author": "Fayaz",
"author_id": 110572,
"author_profile": "https://wordpress.stackexchange.com/users/110572",
"pm_score": 2,
"selected": true,
"text": "<h2>Use a Plugin</h2>\n<p>First of all, your CODE looks fine. However, it's better if you put that code in a smal... | 2022/12/17 | [
"https://wordpress.stackexchange.com/questions/412190",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/146638/"
] | I want to hide, let's say, example.com/services/washing ('Services' is the this is a custom post type) from the search engine and show a 401 error page. How do I? | Use a Plugin
------------
First of all, your CODE looks fine. However, it's better if you put that code in a small custom Plugin. That way, you can easily keep the plugin active on the development and staging sites and deactivate it on the main site.
Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.
Also, we should have debugging enabled on development and staging sites. Often it's done by having different `wp-config.php` files (excluded from Git) on development, staging and production sites.
You may even take advantage of that and set the following `true` on dev and staging, and false on production:
```
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
```
Then never set these to `true` on production, at least not `WP_DEBUG_DISPLAY`. This way, you can just use the plugin and forget it's even there. No further change is needed from staging to production unless you change `WP_DEBUG_DISPLAY` on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.
Here's how the plugin code would look like:
```
<?php
/*
Plugin Name: Custom No Index
Description: A plugin to add a noindex, nofollow meta tag to the head of every page.
Author: Fayaz Ahmed
Version: 1.0
*/
add_action( 'wp_head', 'no_index_on_debug' );
function no_index_on_debug() {
if( WP_DEBUG && WP_DEBUG_DISPLAY ) {
?>
<meta name="robots" content="noindex, nofollow" />
<?php
}
}
```
Use Google Search Console
-------------------------
Secondly, you may also use Google Search Console to expedite the process of de-indexing your staging site's pages. Here are the steps you can take:
1. Go to <https://search.google.com/search-console/> and sign in with your Google account.
2. Select the property (website) that represents your staging site from the list of properties.
3. From the left menu go to: `Indexing` → `Removals`, and in the `Temporary Removals` Tab, use the `NEW REQUEST` button to submit URLs for removal.
It may take some time for Google to process the request to remove the URLs from search results. You can also use the "URL inspection" tool in Search Console to check the status of your request and see if the URL has been removed from the search results. |
412,304 | <p>A few days after installing 6.1.1 some pages started redirecting to the homepage. I renamed .htaccess, disabled all plugins, and am using the 2022 default theme to try to locate the source of the 301 with no luck. So I checked curl, and found the source of the redirect was labeled "Wordpress". So I stopped the redirect and dumped the debug_backtrace in order to finally locate this thing. I'm guessing there is a canonical URL set up, but for the life of me, I can't figure it out.
Any page with the URL <a href="https://stgtrulite.wpengine.com/platform/%5Banything%5D" rel="nofollow noreferrer">https://stgtrulite.wpengine.com/platform/[anything]</a> gets a 301 to <a href="https://stgtrulite.wpengine.com" rel="nofollow noreferrer">https://stgtrulite.wpengine.com</a>. The rest of the site works, and I can change the URL of the affected pages, but google has already crawled them with the URL.<br />
Can someone please help me out?
Here is the dump:</p>
<pre><code>Redirect attempted to location: https://stgtrulite.wpengine.com/
Array
(
[0] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/canonical.php
[line] => 801
[function] => wp_redirect
[args] => Array
(
[0] => https://stgtrulite.wpengine.com/
[1] => 301
)
)
[1] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php
[line] => 308
[function] => redirect_canonical
[args] => Array
(
[0] => https://stgtrulite.wpengine.com/platform/xxx
)
)
[2] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php
[line] => 332
[function] => apply_filters
[class] => WP_Hook
[object] => WP_Hook Object
(
[callbacks] => Array
(
[0] => Array
(
[_wp_admin_bar_init] => Array
(
[function] => _wp_admin_bar_init
[accepted_args] => 1
)
)
[10] => Array
(
[wp_old_slug_redirect] => Array
(
[function] => wp_old_slug_redirect
[accepted_args] => 1
)
[redirect_canonical] => Array
(
[function] => redirect_canonical
[accepted_args] => 1
)
[0000000026d0f2cb000000001a0eef68render_sitemaps] => Array
(
[function] => Array
(
[0] => WP_Sitemaps Object
(
[index] => WP_Sitemaps_Index Object
(
[registry:protected] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[max_sitemaps:WP_Sitemaps_Index:private] => 50000
)
[registry] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[renderer] => WP_Sitemaps_Renderer Object
(
[stylesheet:protected] =>
[stylesheet_index:protected] =>
)
)
[1] => render_sitemaps
)
[accepted_args] => 1
)
)
[11] => Array
(
[rest_output_link_header] => Array
(
[function] => rest_output_link_header
[accepted_args] => 0
)
[wp_shortlink_header] => Array
(
[function] => wp_shortlink_header
[accepted_args] => 0
)
)
[1000] => Array
(
[wp_redirect_admin_locations] => Array
(
[function] => wp_redirect_admin_locations
[accepted_args] => 1
)
)
[99999] => Array
(
[0000000026d0f112000000001a0eef68is_404] => Array
(
[function] => Array
(
[0] => WpeCommon Object
(
[options:protected] =>
)
[1] => is_404
)
[accepted_args] => 1
)
)
)
[iterations:WP_Hook:private] => Array
(
[0] => Array
(
[0] => 0
[1] => 10
[2] => 11
[3] => 1000
[4] => 99999
)
)
[current_priority:WP_Hook:private] => Array
(
[0] => 10
)
[nesting_level:WP_Hook:private] => 1
[doing_action:WP_Hook:private] => 1
)
[type] => ->
[args] => Array
(
[0] =>
[1] => Array
(
[0] =>
)
)
)
[3] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/plugin.php
[line] => 517
[function] => do_action
[class] => WP_Hook
[object] => WP_Hook Object
(
[callbacks] => Array
(
[0] => Array
(
[_wp_admin_bar_init] => Array
(
[function] => _wp_admin_bar_init
[accepted_args] => 1
)
)
[10] => Array
(
[wp_old_slug_redirect] => Array
(
[function] => wp_old_slug_redirect
[accepted_args] => 1
)
[redirect_canonical] => Array
(
[function] => redirect_canonical
[accepted_args] => 1
)
[0000000026d0f2cb000000001a0eef68render_sitemaps] => Array
(
[function] => Array
(
[0] => WP_Sitemaps Object
(
[index] => WP_Sitemaps_Index Object
(
[registry:protected] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[max_sitemaps:WP_Sitemaps_Index:private] => 50000
)
[registry] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[renderer] => WP_Sitemaps_Renderer Object
(
[stylesheet:protected] =>
[stylesheet_index:protected] =>
)
)
[1] => render_sitemaps
)
[accepted_args] => 1
)
)
[11] => Array
(
[rest_output_link_header] => Array
(
[function] => rest_output_link_header
[accepted_args] => 0
)
[wp_shortlink_header] => Array
(
[function] => wp_shortlink_header
[accepted_args] => 0
)
)
[1000] => Array
(
[wp_redirect_admin_locations] => Array
(
[function] => wp_redirect_admin_locations
[accepted_args] => 1
)
)
[99999] => Array
(
[0000000026d0f112000000001a0eef68is_404] => Array
(
[function] => Array
(
[0] => WpeCommon Object
(
[options:protected] =>
)
[1] => is_404
)
[accepted_args] => 1
)
)
)
[iterations:WP_Hook:private] => Array
(
[0] => Array
(
[0] => 0
[1] => 10
[2] => 11
[3] => 1000
[4] => 99999
)
)
[current_priority:WP_Hook:private] => Array
(
[0] => 10
)
[nesting_level:WP_Hook:private] => 1
[doing_action:WP_Hook:private] => 1
)
[type] => ->
[args] => Array
(
[0] => Array
(
[0] =>
)
)
)
[4] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/template-loader.php
[line] => 13
[function] => do_action
[args] => Array
(
[0] => template_redirect
)
)
[5] => Array
(
[file] => /nas/content/live/stgtrulite/wp-blog-header.php
[line] => 19
[args] => Array
(
[0] => /nas/content/live/stgtrulite/wp-includes/template-loader.php
)
[function] => require_once
)
[6] => Array
(
[file] => /nas/content/live/stgtrulite/index.php
[line] => 17
[args] => Array
(
[0] => /nas/content/live/stgtrulite/wp-blog-header.php
)
[function] => require
)
)
</code></pre>
| [
{
"answer_id": 412270,
"author": "Conor Treacy",
"author_id": 222130,
"author_profile": "https://wordpress.stackexchange.com/users/222130",
"pm_score": 2,
"selected": false,
"text": "<p>See @Tamara answers below regarding edits in phpmyadmin for user role levels.</p>\n<p>There is likely ... | 2022/12/24 | [
"https://wordpress.stackexchange.com/questions/412304",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/206120/"
] | A few days after installing 6.1.1 some pages started redirecting to the homepage. I renamed .htaccess, disabled all plugins, and am using the 2022 default theme to try to locate the source of the 301 with no luck. So I checked curl, and found the source of the redirect was labeled "Wordpress". So I stopped the redirect and dumped the debug\_backtrace in order to finally locate this thing. I'm guessing there is a canonical URL set up, but for the life of me, I can't figure it out.
Any page with the URL [https://stgtrulite.wpengine.com/platform/[anything]](https://stgtrulite.wpengine.com/platform/%5Banything%5D) gets a 301 to <https://stgtrulite.wpengine.com>. The rest of the site works, and I can change the URL of the affected pages, but google has already crawled them with the URL.
Can someone please help me out?
Here is the dump:
```
Redirect attempted to location: https://stgtrulite.wpengine.com/
Array
(
[0] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/canonical.php
[line] => 801
[function] => wp_redirect
[args] => Array
(
[0] => https://stgtrulite.wpengine.com/
[1] => 301
)
)
[1] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php
[line] => 308
[function] => redirect_canonical
[args] => Array
(
[0] => https://stgtrulite.wpengine.com/platform/xxx
)
)
[2] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php
[line] => 332
[function] => apply_filters
[class] => WP_Hook
[object] => WP_Hook Object
(
[callbacks] => Array
(
[0] => Array
(
[_wp_admin_bar_init] => Array
(
[function] => _wp_admin_bar_init
[accepted_args] => 1
)
)
[10] => Array
(
[wp_old_slug_redirect] => Array
(
[function] => wp_old_slug_redirect
[accepted_args] => 1
)
[redirect_canonical] => Array
(
[function] => redirect_canonical
[accepted_args] => 1
)
[0000000026d0f2cb000000001a0eef68render_sitemaps] => Array
(
[function] => Array
(
[0] => WP_Sitemaps Object
(
[index] => WP_Sitemaps_Index Object
(
[registry:protected] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[max_sitemaps:WP_Sitemaps_Index:private] => 50000
)
[registry] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[renderer] => WP_Sitemaps_Renderer Object
(
[stylesheet:protected] =>
[stylesheet_index:protected] =>
)
)
[1] => render_sitemaps
)
[accepted_args] => 1
)
)
[11] => Array
(
[rest_output_link_header] => Array
(
[function] => rest_output_link_header
[accepted_args] => 0
)
[wp_shortlink_header] => Array
(
[function] => wp_shortlink_header
[accepted_args] => 0
)
)
[1000] => Array
(
[wp_redirect_admin_locations] => Array
(
[function] => wp_redirect_admin_locations
[accepted_args] => 1
)
)
[99999] => Array
(
[0000000026d0f112000000001a0eef68is_404] => Array
(
[function] => Array
(
[0] => WpeCommon Object
(
[options:protected] =>
)
[1] => is_404
)
[accepted_args] => 1
)
)
)
[iterations:WP_Hook:private] => Array
(
[0] => Array
(
[0] => 0
[1] => 10
[2] => 11
[3] => 1000
[4] => 99999
)
)
[current_priority:WP_Hook:private] => Array
(
[0] => 10
)
[nesting_level:WP_Hook:private] => 1
[doing_action:WP_Hook:private] => 1
)
[type] => ->
[args] => Array
(
[0] =>
[1] => Array
(
[0] =>
)
)
)
[3] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/plugin.php
[line] => 517
[function] => do_action
[class] => WP_Hook
[object] => WP_Hook Object
(
[callbacks] => Array
(
[0] => Array
(
[_wp_admin_bar_init] => Array
(
[function] => _wp_admin_bar_init
[accepted_args] => 1
)
)
[10] => Array
(
[wp_old_slug_redirect] => Array
(
[function] => wp_old_slug_redirect
[accepted_args] => 1
)
[redirect_canonical] => Array
(
[function] => redirect_canonical
[accepted_args] => 1
)
[0000000026d0f2cb000000001a0eef68render_sitemaps] => Array
(
[function] => Array
(
[0] => WP_Sitemaps Object
(
[index] => WP_Sitemaps_Index Object
(
[registry:protected] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[max_sitemaps:WP_Sitemaps_Index:private] => 50000
)
[registry] => WP_Sitemaps_Registry Object
(
[providers:WP_Sitemaps_Registry:private] => Array
(
[posts] => WP_Sitemaps_Posts Object
(
[name:protected] => posts
[object_type:protected] => post
)
[taxonomies] => WP_Sitemaps_Taxonomies Object
(
[name:protected] => taxonomies
[object_type:protected] => term
)
[users] => WP_Sitemaps_Users Object
(
[name:protected] => users
[object_type:protected] => user
)
)
)
[renderer] => WP_Sitemaps_Renderer Object
(
[stylesheet:protected] =>
[stylesheet_index:protected] =>
)
)
[1] => render_sitemaps
)
[accepted_args] => 1
)
)
[11] => Array
(
[rest_output_link_header] => Array
(
[function] => rest_output_link_header
[accepted_args] => 0
)
[wp_shortlink_header] => Array
(
[function] => wp_shortlink_header
[accepted_args] => 0
)
)
[1000] => Array
(
[wp_redirect_admin_locations] => Array
(
[function] => wp_redirect_admin_locations
[accepted_args] => 1
)
)
[99999] => Array
(
[0000000026d0f112000000001a0eef68is_404] => Array
(
[function] => Array
(
[0] => WpeCommon Object
(
[options:protected] =>
)
[1] => is_404
)
[accepted_args] => 1
)
)
)
[iterations:WP_Hook:private] => Array
(
[0] => Array
(
[0] => 0
[1] => 10
[2] => 11
[3] => 1000
[4] => 99999
)
)
[current_priority:WP_Hook:private] => Array
(
[0] => 10
)
[nesting_level:WP_Hook:private] => 1
[doing_action:WP_Hook:private] => 1
)
[type] => ->
[args] => Array
(
[0] => Array
(
[0] =>
)
)
)
[4] => Array
(
[file] => /nas/content/live/stgtrulite/wp-includes/template-loader.php
[line] => 13
[function] => do_action
[args] => Array
(
[0] => template_redirect
)
)
[5] => Array
(
[file] => /nas/content/live/stgtrulite/wp-blog-header.php
[line] => 19
[args] => Array
(
[0] => /nas/content/live/stgtrulite/wp-includes/template-loader.php
)
[function] => require_once
)
[6] => Array
(
[file] => /nas/content/live/stgtrulite/index.php
[line] => 17
[args] => Array
(
[0] => /nas/content/live/stgtrulite/wp-blog-header.php
)
[function] => require
)
)
``` | In WordPress, there is no concept of "super admins" in the same way that there is in a multisite installation. However, there may be users with the "administrator" role who have access to all areas of the site, including the WordPress settings.
If you are an administrator and you are unable to access the WordPress settings, it could be due to a number of reasons. Here are a few things you could try:
* Check that you are logged in with an account that has the "administrator" role.
* Check if there are any plugins or themes that may be blocking access to the settings. You can try deactivating all plugins and switching to a default theme to see if this resolves the issue.
* Check if there are any errors in your site's `wp-config.php` file that may be preventing access to the settings.
* If you are using a caching plugin, try clearing the cache to see if that resolves the issue.
If none of these suggestions helps, you may need to access the site's database and check via your Host cpanel for any issues there. You can use a tool like `phpMyAdmin` to access the database `wp_users` table and check for any problems.
while on `PHPMyAdmin`, Check if there are any issues with the user roles: The user roles in WordPress determine what permissions users have on the site. If your user role has been changed or there are any issues with the user roles, it could prevent you from accessing the dashboard. You can check the `wp_usermeta` table to see if there are any issues with the user roles.
To change user roles in the wp\_usermeta table in WordPress using phpMyAdmin, you can follow these steps:
1. Log in to your hosting account and open the phpMyAdmin tool.
2. Select the WordPress database from the list of databases on the left side of the page.
3. Click on the `wp_usermeta` table to open it.
4. Click on the "Browse" tab to view the contents of the table.
5. Find the row corresponding to the user whose role you want to change. The `user_id` column will contain the ID of the user, and the `meta_key` column will contain the string "`wp_capabilities`".
6. Click on the "Edit" link for the row you want to modify.
7. In the "meta\_value" field, enter the desired role for the user. The role should be specified as a serialized array, with the key corresponding to the role and the value set to true. For example, to set the user's role to "administrator", you would enter the following value in the "meta\_value" field: `a:1:{s:13:"administrator";b:1;}`.
if a user has the "administrator" role, the `wp_capabilities` field for that user might contain the following value: `a:1:{s:13:"administrator";b:1;}`. This value indicates that the user has the "administrator" role, with the key `s:13:"administrator"` corresponding to the role and the value `b:1;` indicating that the `role is enabled`.
8. Click the "Go" button to save the changes.
Please note that changing user roles in the database can have serious consequences if not done carefully. It is important to make sure you understand the implications of modifying the database before making any changes. If you are not comfortable working with databases, it is best to seek the help of a developer or database administrator.
I hope this helps! Let me know if you have any other questions. |
412,339 | <p>How can I get post data or just post Id inside of a pattern?</p>
<p>I've created the following pattern file:</p>
<pre><code><?php
/**
* Title: Post link
* Slug: mytheme/post-link
*/
?>
<!-- wp:html -->
<div>
<?php
$id = $postId; //how can I get it????
$post = get_post($postId);
$slug = $post['slug'];
?>
<a href="<?= $slug; ?>">Some Button leading to a post</a>
</div>
<!-- /wp:html -->
</code></pre>
| [
{
"answer_id": 412347,
"author": "Buttered_Toast",
"author_id": 192133,
"author_profile": "https://wordpress.stackexchange.com/users/192133",
"pm_score": -1,
"selected": false,
"text": "<p>You can use <code>get_the_ID()</code>.<br />\n<a href=\"https://developer.wordpress.org/reference/f... | 2022/12/25 | [
"https://wordpress.stackexchange.com/questions/412339",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/227201/"
] | How can I get post data or just post Id inside of a pattern?
I've created the following pattern file:
```
<?php
/**
* Title: Post link
* Slug: mytheme/post-link
*/
?>
<!-- wp:html -->
<div>
<?php
$id = $postId; //how can I get it????
$post = get_post($postId);
$slug = $post['slug'];
?>
<a href="<?= $slug; ?>">Some Button leading to a post</a>
</div>
<!-- /wp:html -->
``` | In block themes patterns won't have access to context such as id it seems:
<https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns>
One has to create a custom block to get post id and use useSelect hook to get post Id like so:
`import { useSelect } from "@wordpress/data";`
...
inside Edit block function:
`const postId = useSelect(select => select('core/editor').getCurrentPostId());`
then, postId can be used inside edit function and if it has to be used in save function, `useEffect` should be used inside edit to store id to attribute like so:
```
useEffect(() => {
if (postId) {
setAttributes({postId})
}, [postId]);
```
Provided you have defined postId attribute in `block.json`, you can get and use that attribute in save function or render\_callback. |
412,404 | <p>The shortcode I'm using is:</p>
<pre><code>[survey_records id=number qid="3" aid="selected" data="answer" uid="68" session="last"]
</code></pre>
<p>I want the <code>id</code> to be variable, like:</p>
<pre><code>[survey_records id="$variable" qid="3" aid="selected" data="answer" uid="68" session="last"]
</code></pre>
<p>How can I change the <code>id</code> parameter to a dynamic variable?</p>
| [
{
"answer_id": 412344,
"author": "Rick Hellewell",
"author_id": 29416,
"author_profile": "https://wordpress.stackexchange.com/users/29416",
"pm_score": 0,
"selected": false,
"text": "<p>Ask the googles for 'what wordpress theme is that'. You will find several sites that will tell you tha... | 2022/12/28 | [
"https://wordpress.stackexchange.com/questions/412404",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228620/"
] | The shortcode I'm using is:
```
[survey_records id=number qid="3" aid="selected" data="answer" uid="68" session="last"]
```
I want the `id` to be variable, like:
```
[survey_records id="$variable" qid="3" aid="selected" data="answer" uid="68" session="last"]
```
How can I change the `id` parameter to a dynamic variable? | You can also view source or use inspect element in your browser. From there, search for "theme" and you'll find the wp-content/themes/ folder and then the name of the theme right after it (if they're using WordPress). Similar with plugins, you can usually find references to the plugin in the source code on the site.
As @rick mentioned, you can use some searches on Google, or using a site called <https://builtwith.com> and that'll usually give you a bunch of info. Normally not EVERY plugin is listed, but it'll give you a chunk to get started. |
412,407 | <p>I am working with code in a custom child-theme. My goal is to pull data from the wpdb and display it as a custom table.
I have created and populated the custom wpdb table with the relevant data, and I am creating the table. However, in the parent theme header styles files, there is a div:</p>
<pre><code><div id="inner-wrap" class="wrap hfeed kt-clear">
<?php
/**
* Hook for top of inner wrap.
*/
do_action( 'kadence_before_content' );
?>
</code></pre>
<p>that seems to take up a large chunk of the page before my table loads. It always takes up the entire page and forces me to scroll down to see the start of my table. No matter how I zoom in or out, I always need to scroll to even see the start.
I have tried assigning my custom table the same ID and Class from that header div, but that has not worked.</p>
<p>The current code to create my table, is located in a custom php file that is used as the template for the page in question. The code looks like this:</p>
<pre><code><table id = "inner-wrap" class="empTable" border='1'>
<tr>
<th>Name</th>
<th>ID</th>
<th>Active</th>
</tr>
<?php
/*
Template Name: Custom Table
*/
get_header();
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM DBTable" );
foreach ( $result as $print ) {
echo '<tr>';
echo '<td>', $print->name,'</td>';
echo '<td>', $print->id,'</td>';
if($print->active == 1){
echo '<td>', 'Active','</td>';
}else{
echo '<td>', 'Inactive','</td>';
}
echo '</tr>';
}echo '</table>';
get_footer();
</code></pre>
| [
{
"answer_id": 412344,
"author": "Rick Hellewell",
"author_id": 29416,
"author_profile": "https://wordpress.stackexchange.com/users/29416",
"pm_score": 0,
"selected": false,
"text": "<p>Ask the googles for 'what wordpress theme is that'. You will find several sites that will tell you tha... | 2022/12/28 | [
"https://wordpress.stackexchange.com/questions/412407",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228625/"
] | I am working with code in a custom child-theme. My goal is to pull data from the wpdb and display it as a custom table.
I have created and populated the custom wpdb table with the relevant data, and I am creating the table. However, in the parent theme header styles files, there is a div:
```
<div id="inner-wrap" class="wrap hfeed kt-clear">
<?php
/**
* Hook for top of inner wrap.
*/
do_action( 'kadence_before_content' );
?>
```
that seems to take up a large chunk of the page before my table loads. It always takes up the entire page and forces me to scroll down to see the start of my table. No matter how I zoom in or out, I always need to scroll to even see the start.
I have tried assigning my custom table the same ID and Class from that header div, but that has not worked.
The current code to create my table, is located in a custom php file that is used as the template for the page in question. The code looks like this:
```
<table id = "inner-wrap" class="empTable" border='1'>
<tr>
<th>Name</th>
<th>ID</th>
<th>Active</th>
</tr>
<?php
/*
Template Name: Custom Table
*/
get_header();
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM DBTable" );
foreach ( $result as $print ) {
echo '<tr>';
echo '<td>', $print->name,'</td>';
echo '<td>', $print->id,'</td>';
if($print->active == 1){
echo '<td>', 'Active','</td>';
}else{
echo '<td>', 'Inactive','</td>';
}
echo '</tr>';
}echo '</table>';
get_footer();
``` | You can also view source or use inspect element in your browser. From there, search for "theme" and you'll find the wp-content/themes/ folder and then the name of the theme right after it (if they're using WordPress). Similar with plugins, you can usually find references to the plugin in the source code on the site.
As @rick mentioned, you can use some searches on Google, or using a site called <https://builtwith.com> and that'll usually give you a bunch of info. Normally not EVERY plugin is listed, but it'll give you a chunk to get started. |
412,466 | <p>Please vet this code and help me with how to declare '.($a['link']).' variable such that i can echo its content in single.php</p>
<pre><code>function mp3_download_link_att($atts, $content = null) {
$default = array(
'link' => '#',
);
session_start();
global $post;
$title = get_the_title($post->ID);
$a = shortcode_atts($default, $atts);
$content = do_shortcode($content);
return ' <h2>Download '.$title.' Mp3 Audio</h2><p style="text-align: center;"><strong>Download Mp3 audio, listen and share this amazing song for free and stay happy.</strong></p><figure class="wp-block-audio"><audio class="audioPlayer" src="'.($a['link']).'" controls="controls"></audio></figure><center><p class="song-download"><a rel="nofollow" id="dlf" class="button download" href="'.($a['link']).'"><span class="fa fa-download"></span> DOWNLOAD '.$content.' MP3 <span class="fa fa-music"></span> </a></p></center>';
}
$_SESSION['myduration'] = ($a['link']);
add_shortcode('mp3download', 'mp3_download_link_att');
</code></pre>
| [
{
"answer_id": 412344,
"author": "Rick Hellewell",
"author_id": 29416,
"author_profile": "https://wordpress.stackexchange.com/users/29416",
"pm_score": 0,
"selected": false,
"text": "<p>Ask the googles for 'what wordpress theme is that'. You will find several sites that will tell you tha... | 2022/12/30 | [
"https://wordpress.stackexchange.com/questions/412466",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228682/"
] | Please vet this code and help me with how to declare '.($a['link']).' variable such that i can echo its content in single.php
```
function mp3_download_link_att($atts, $content = null) {
$default = array(
'link' => '#',
);
session_start();
global $post;
$title = get_the_title($post->ID);
$a = shortcode_atts($default, $atts);
$content = do_shortcode($content);
return ' <h2>Download '.$title.' Mp3 Audio</h2><p style="text-align: center;"><strong>Download Mp3 audio, listen and share this amazing song for free and stay happy.</strong></p><figure class="wp-block-audio"><audio class="audioPlayer" src="'.($a['link']).'" controls="controls"></audio></figure><center><p class="song-download"><a rel="nofollow" id="dlf" class="button download" href="'.($a['link']).'"><span class="fa fa-download"></span> DOWNLOAD '.$content.' MP3 <span class="fa fa-music"></span> </a></p></center>';
}
$_SESSION['myduration'] = ($a['link']);
add_shortcode('mp3download', 'mp3_download_link_att');
``` | You can also view source or use inspect element in your browser. From there, search for "theme" and you'll find the wp-content/themes/ folder and then the name of the theme right after it (if they're using WordPress). Similar with plugins, you can usually find references to the plugin in the source code on the site.
As @rick mentioned, you can use some searches on Google, or using a site called <https://builtwith.com> and that'll usually give you a bunch of info. Normally not EVERY plugin is listed, but it'll give you a chunk to get started. |
412,488 | <p>I want to remove the main title ("KEZDŐLAP"), but only from the homepage, the 2 codes below works, except if I put the page-id code in front of them. Why might this happen?</p>
<p>.page-id-8178 .woocommerce-products-header__title{
display:none!important;
}</p>
<p>.page-id-8178 .page-title{
display:none!important;
}</p>
<p>Site: <a href="https://www.boltway.hu/" rel="nofollow noreferrer">https://www.boltway.hu/</a></p>
| [
{
"answer_id": 412489,
"author": "Irfan",
"author_id": 193019,
"author_profile": "https://wordpress.stackexchange.com/users/193019",
"pm_score": 2,
"selected": false,
"text": "<p>You can use <code>home</code> class in body tag to target homepage. Also avoid using <code>!important</code> ... | 2022/12/31 | [
"https://wordpress.stackexchange.com/questions/412488",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228706/"
] | I want to remove the main title ("KEZDŐLAP"), but only from the homepage, the 2 codes below works, except if I put the page-id code in front of them. Why might this happen?
.page-id-8178 .woocommerce-products-header\_\_title{
display:none!important;
}
.page-id-8178 .page-title{
display:none!important;
}
Site: <https://www.boltway.hu/> | You can use `home` class in body tag to target homepage. Also avoid using `!important` for css. which is not a good practice.
try the following css:
```
body.home .woocommerce-products-header__title { display:none; }
body.home .page-title { display:none; }
``` |
412,598 | <p>I have Done Some Debugging is there:</p>
<p>1, Deactivate Plugins
2, Switch Themes
3, Update plugins & themes
4, update the WordPress version
5, in functions.php :</p>
<pre><code>function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
</code></pre>
<p>6,In wp-config.php</p>
<pre><code>define( 'AUTOSAVE_INTERVAL', 3600 ); // autosave 1x per hour
define( 'WP_POST_REVISIONS', false ); // no revisions
</code></pre>
| [
{
"answer_id": 412489,
"author": "Irfan",
"author_id": 193019,
"author_profile": "https://wordpress.stackexchange.com/users/193019",
"pm_score": 2,
"selected": false,
"text": "<p>You can use <code>home</code> class in body tag to target homepage. Also avoid using <code>!important</code> ... | 2023/01/05 | [
"https://wordpress.stackexchange.com/questions/412598",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/225694/"
] | I have Done Some Debugging is there:
1, Deactivate Plugins
2, Switch Themes
3, Update plugins & themes
4, update the WordPress version
5, in functions.php :
```
function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
```
6,In wp-config.php
```
define( 'AUTOSAVE_INTERVAL', 3600 ); // autosave 1x per hour
define( 'WP_POST_REVISIONS', false ); // no revisions
``` | You can use `home` class in body tag to target homepage. Also avoid using `!important` for css. which is not a good practice.
try the following css:
```
body.home .woocommerce-products-header__title { display:none; }
body.home .page-title { display:none; }
``` |
412,640 | <p>I want to send a variable with a url and get the value and insert that value to a variable.</p>
<pre><code><a href="domain/newsletter-by-year?year=2020">GO TO THE NEWSLETTER FROM 2020</a>
</code></pre>
<p>ang get it in this url</p>
<p>https://domain/newsletter-by-year?year=2020</p>
<p>This is my wpquery</p>
<pre><code> /* Template Name: newsletter_by_year */
$year = $_GET["year"];
$args = array(
'post_type' => 'post',
'category_name' => 'news-letter',
'posts_per_page' => 10,
'date_query' => array(
array(
'year' => $year,
),
),
);
$myQuery = new WP_Query($args);
</code></pre>
<p>but im getting a 404 page.</p>
| [
{
"answer_id": 412489,
"author": "Irfan",
"author_id": 193019,
"author_profile": "https://wordpress.stackexchange.com/users/193019",
"pm_score": 2,
"selected": false,
"text": "<p>You can use <code>home</code> class in body tag to target homepage. Also avoid using <code>!important</code> ... | 2023/01/06 | [
"https://wordpress.stackexchange.com/questions/412640",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/181226/"
] | I want to send a variable with a url and get the value and insert that value to a variable.
```
<a href="domain/newsletter-by-year?year=2020">GO TO THE NEWSLETTER FROM 2020</a>
```
ang get it in this url
https://domain/newsletter-by-year?year=2020
This is my wpquery
```
/* Template Name: newsletter_by_year */
$year = $_GET["year"];
$args = array(
'post_type' => 'post',
'category_name' => 'news-letter',
'posts_per_page' => 10,
'date_query' => array(
array(
'year' => $year,
),
),
);
$myQuery = new WP_Query($args);
```
but im getting a 404 page. | You can use `home` class in body tag to target homepage. Also avoid using `!important` for css. which is not a good practice.
try the following css:
```
body.home .woocommerce-products-header__title { display:none; }
body.home .page-title { display:none; }
``` |
412,716 | <p>I am using the <a href="https://wordpress.org/plugins/pages-with-category-and-tag/" rel="nofollow noreferrer">Pages with category and tag</a> plugin to assign tags and categories to pages. And now I would like to retrieve a list of items with specific tags associated with a page and can’t seem to get it to work.</p>
<p>The code I am using is as follows; kludged together from what I can find online for fetching posts based on tags like <a href="https://stackoverflow.com/a/71025941/117259">this StackOverflow post</a>. And please excuse the very much “development” roughness in place in this stuff for now:</p>
<pre><code><?php
$tags = get_the_tags();
print_r($tags);
$args = array(
"numberposts" => 3,
"post_type" => "page",
"tax_query" => array(
array(
"taxonomy" => "page_tag",
"field" => "term_id",
"terms" => $tags
)
)
);
$pages = get_pages( $args );
print_r($pages);
?>
</code></pre>
| [
{
"answer_id": 412717,
"author": "WebElaine",
"author_id": 102815,
"author_profile": "https://wordpress.stackexchange.com/users/102815",
"pm_score": 2,
"selected": false,
"text": "<p><code>get_pages()</code> is a valid function, but it doesn't have any parameters for getting pages with s... | 2023/01/09 | [
"https://wordpress.stackexchange.com/questions/412716",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/52852/"
] | I am using the [Pages with category and tag](https://wordpress.org/plugins/pages-with-category-and-tag/) plugin to assign tags and categories to pages. And now I would like to retrieve a list of items with specific tags associated with a page and can’t seem to get it to work.
The code I am using is as follows; kludged together from what I can find online for fetching posts based on tags like [this StackOverflow post](https://stackoverflow.com/a/71025941/117259). And please excuse the very much “development” roughness in place in this stuff for now:
```
<?php
$tags = get_the_tags();
print_r($tags);
$args = array(
"numberposts" => 3,
"post_type" => "page",
"tax_query" => array(
array(
"taxonomy" => "page_tag",
"field" => "term_id",
"terms" => $tags
)
)
);
$pages = get_pages( $args );
print_r($pages);
?>
``` | Okay, while `WP_Query` suggestion [posted in an earlier answer](https://wordpress.stackexchange.com/a/412717/52852) *should* work for me, it wasn’t working as expected.
So I figured out how to do this using `get_posts` instead: Instinctively one would think to get pages one needs to use `get_pages` but (and this is the key) you can get pages via `get_posts` as well as long as `post_type` is set `page` in the arguments. I came to this conclusion when I realized that posts and pages are both stored in `wp_posts` so `post_type` should work and it indeed did work!
This is what finally worked for me; just change the `$tag` value to match the tag value you want to use:
```
<?php
$tags = array('TheTagName');
$args = array(
'posts_per_page' => 10,
'tag' => $tags,
'post_type' => 'page',
'post_status' => 'publish',
'post_type' => array( 'page' )
);
$query = get_posts( $args );
echo '<ul class="page-list subpages-page-list">';
foreach ( $query as $post ) : setup_postdata( $post );
echo sprintf('<li class="page_item page-item-%d menu-item">', $post->ID);
echo "<a href='" .$post->guid . "'>" . $post->post_title . "</a>";
echo '</li>';
endforeach;
echo '</ul>';
wp_reset_postdata();
?>
``` |
412,730 | <p>I wrote the following code in a standalone plugin, but it doesn't work<br/>
Please guide me how to modify the code, so the JS file is loaded.<br/></p>
<pre><code><?php
/*
Plugin Name: Copy post
*/
class CopyPostApi{
public function __construct(){
// Add assets
add_action( 'wp_enqueue_scripts', array($this, 'load_assets'));
}
public function load_assets()
{
wp_enqueue_script(
'main_js',
plugin_dir_url(__FILE__) . 'assets/main.js',
array(),
1,
true
);
}
}
new CopyPostApi;
</code></pre>
<p>Note: I searched and used the suggested codes, but it didn't work</p>
| [
{
"answer_id": 412731,
"author": "Prince Patel",
"author_id": 228933,
"author_profile": "https://wordpress.stackexchange.com/users/228933",
"pm_score": -1,
"selected": false,
"text": "<p>1)check the location of javascript file it must in correct directory.</p>\n<ol start=\"2\">\n<li>The... | 2023/01/10 | [
"https://wordpress.stackexchange.com/questions/412730",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/135260/"
] | I wrote the following code in a standalone plugin, but it doesn't work
Please guide me how to modify the code, so the JS file is loaded.
```
<?php
/*
Plugin Name: Copy post
*/
class CopyPostApi{
public function __construct(){
// Add assets
add_action( 'wp_enqueue_scripts', array($this, 'load_assets'));
}
public function load_assets()
{
wp_enqueue_script(
'main_js',
plugin_dir_url(__FILE__) . 'assets/main.js',
array(),
1,
true
);
}
}
new CopyPostApi;
```
Note: I searched and used the suggested codes, but it didn't work | Your code seems to be fine, so I think the problem will rather be in your theme. Are you developing your own theme too? The wp\_head function calls in those files, which were hooked to wp\_enqueue\_scripts. It should be in the theme between the head tags, similarly as you see here:
<https://developer.wordpress.org/reference/functions/wp_head/#comment-900> |
412,833 | <p><strong>Setup 1 :</strong></p>
<p>The general subdomain/custom-domain based multisite setup for child network sites has its upload directory like this</p>
<p><code>/home/example1.com/public_html/wp-content/uploads/sites/8/2022/01/logo.png</code></p>
<p>example1.com : the primary WordPress multisite network</p>
<p>example2.com : the child network site with site id 8 under example1.com</p>
<p>This file can be accessed from the child network site from the following URL</p>
<p><code>https://www.example2.com/wp-content/uploads/sites/8/2022/01/logo.png</code></p>
<p>the general .htaccess file for subdomain based network site is following</p>
<pre><code>
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
</code></pre>
<p><strong>Setup 2 :</strong></p>
<p>In a subdomain/custom-domain based multisite setup I've got this upload directory, it uses blogs.dir instead of uploads directory</p>
<p><code>/home/example1.com/public_html/wp-content/blogs.dir/8/files/2022/01/logo.png</code></p>
<p>The child network site has following file path</p>
<p><code>example2.com/files/2022/01/logo.png</code></p>
<p>.htaccess of this setup is here</p>
<pre><code>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</code></pre>
<p>I've tried using this for new general installation where the intended upload path is blogs.dir but having this .htaccess does nothing.</p>
<p>There is no such difference in wp-config.php file that could affect this setup</p>
<pre><code>
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'www.example1.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define('ADMIN_COOKIE_PATH', '/'); // removed for hide my wp ghost plugin
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
define( 'NOBLOGREDIRECT', '/404' );
</code></pre>
<p>Both setup was done by me and I don't remember any settings inside the dashboard that could change this. Permalinks checked; all possible settings inside the dashboard checked.</p>
<p>General multisite installation exposes site id in media path like this</p>
<p><code>https://www.example2.com/wp-content/uploads/sites/8/2022/01/logo.png</code></p>
<p>The goal is not to expose site id in media path
<code>example2.com/files/2022/01/logo.png</code></p>
<p>What am I missing here?</p>
| [
{
"answer_id": 413171,
"author": "Tutul Ahmed",
"author_id": 229401,
"author_profile": "https://wordpress.stackexchange.com/users/229401",
"pm_score": 0,
"selected": false,
"text": "<p>Perhaps this may help -</p>\n<p>First, locate the wp-config.php file in your WordPress installation dir... | 2023/01/14 | [
"https://wordpress.stackexchange.com/questions/412833",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/18249/"
] | **Setup 1 :**
The general subdomain/custom-domain based multisite setup for child network sites has its upload directory like this
`/home/example1.com/public_html/wp-content/uploads/sites/8/2022/01/logo.png`
example1.com : the primary WordPress multisite network
example2.com : the child network site with site id 8 under example1.com
This file can be accessed from the child network site from the following URL
`https://www.example2.com/wp-content/uploads/sites/8/2022/01/logo.png`
the general .htaccess file for subdomain based network site is following
```
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress
```
**Setup 2 :**
In a subdomain/custom-domain based multisite setup I've got this upload directory, it uses blogs.dir instead of uploads directory
`/home/example1.com/public_html/wp-content/blogs.dir/8/files/2022/01/logo.png`
The child network site has following file path
`example2.com/files/2022/01/logo.png`
.htaccess of this setup is here
```
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
```
I've tried using this for new general installation where the intended upload path is blogs.dir but having this .htaccess does nothing.
There is no such difference in wp-config.php file that could affect this setup
```
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'www.example1.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
define('ADMIN_COOKIE_PATH', '/'); // removed for hide my wp ghost plugin
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
define( 'NOBLOGREDIRECT', '/404' );
```
Both setup was done by me and I don't remember any settings inside the dashboard that could change this. Permalinks checked; all possible settings inside the dashboard checked.
General multisite installation exposes site id in media path like this
`https://www.example2.com/wp-content/uploads/sites/8/2022/01/logo.png`
The goal is not to expose site id in media path
`example2.com/files/2022/01/logo.png`
What am I missing here? | I can see a few possibilities:
1. Custom Uploads directory (`blogs.dir`) is not properly setup in `wp-config.php`. While `wp-content/uploads` is by default taken by WordPress, `wp-content/blogs.dir` must be setup somewhere. I don't see it in your provided code anywhere.
2. A custom directory like `blogs.dir` can be symbolically linked to `wp-content/uploads`. Check if any of your previous setup has such symbolic links in the filesystem. You may connect to the server (SSH) and run the shell command like `ls -alh` to check symlinks.
3. `.htaccess` file not properly routing requests for the files located in the `blogs.dir` directory. Double-check that the `mod_rewrite` module is enabled in your Apache server and that the `.htaccess` file has the correct permissions to be read by the server.
Additionally, you may want to check your server's error logs for any related issues. |
412,855 | <p>As the title says, I just need to get user meta by the user ID in a custom Gutenberg block (editor side). Essentially what this would return in PHP: <code>get_user_meta( $user_id, 'meta_key', true );</code> is the data that I need.</p>
<p><code>wp.data.select('core').getUserMeta(userId,'meta_key',true);</code> doesn't seem to work, but it was a total guess as I can't seem to find any documentation about it. Does anyone know how I can do this?</p>
| [
{
"answer_id": 412867,
"author": "Shoelaced",
"author_id": 59638,
"author_profile": "https://wordpress.stackexchange.com/users/59638",
"pm_score": 1,
"selected": true,
"text": "<p>With thanks to @Lovor's investigative answer, here's the approach that worked for me.</p>\n<h3>1. Add meta t... | 2023/01/15 | [
"https://wordpress.stackexchange.com/questions/412855",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/59638/"
] | As the title says, I just need to get user meta by the user ID in a custom Gutenberg block (editor side). Essentially what this would return in PHP: `get_user_meta( $user_id, 'meta_key', true );` is the data that I need.
`wp.data.select('core').getUserMeta(userId,'meta_key',true);` doesn't seem to work, but it was a total guess as I can't seem to find any documentation about it. Does anyone know how I can do this? | With thanks to @Lovor's investigative answer, here's the approach that worked for me.
### 1. Add meta to REST as JSON:
In the plugin or theme functions, get the meta, `maybe_unserialize` it, `json_encode` it, and add it to the REST API:
```
function add_custom_meta_to_rest( $data, $user, $context ) {
// Add some check here to set a default value if the key does not exist.
$usermeta = get_user_meta( $user->ID, 'meta_key', true );
$data->data['meta']['meta_key'] = json_encode( maybe_unserialize( $usermeta ) );
return $data;
}
add_filter( 'rest_prepare_user', 'add_custom_meta_to_rest', 10, 3 );
```
### 2. Get the data in your block
In your block JS file, import `useSelect` and from there you can get the data inside your `edit` function:
```
// Import `useSelect`.
import { useSelect } from '@wordpress/data';
// Get users.
const users = useSelect(select => select('core').getUsers());
// Get user meta from `users` and parse the JSON.
// Be sure the user ID is set first, in this case as an attribute.
// Also be sure to replace the meta key.
var userMeta = users && users.length > 0 && users.find((user) => user.id === attributes.userId).meta.meta_key;
userMeta = JSON.parse(userMeta);
```
Test it to be sure: `console.log(userMeta)`
### 3. FYI...
If you want, you can also get the current user:
```
const currentUser = useSelect(select => select('core').getCurrentUser());
```
And then set `userId` as the current user's ID if it isn't set:
```
// You'll have import `useEffect` for this:
import { useEffect } from '@wordpress/element';
// Set userId to the current user id if it is not set.
useEffect(() => {
if (!attributes.userId) {
setAttributes({ userId: currentUser.id });
}
}, []);
```
In my case, I needed all users anyway, but you can also get a single value by user ID, as @Lovor described:
```
const userName = useSelect(select => select('core').getUser(1,{'_fields':'name'}));
console.log(userName);
```
Note that if the metadata was an associative PHP array it'll be parsed as a Javascript object. If you want, you could convert it to an array of objects to more easily loop through and use the keys as values:
```
if (userMeta && typeof userMeta === 'object') {
userMeta = Object.keys(userMeta).map((key) => {
return { ...userMeta[key], id: key };
});
}
```
Hope this helps someone. |
412,968 | <p>I'm creating a new API route that allows me to update a plugin database entries on custom table from an external application (below the code). My code seems to work, but I need an advice on how to block requests that don't belong to my app, in order to prevent an arbitrary user that discovers the route and knows for example how to use postman could edit the database. I was thinking to put <code>get_http_origin()</code> on the top of the <code>register_rest_route</code> callback function, comparing the origin of the request with a fixed string I know being the legitimate application. Will it work? Is there a more proficient/correct method?</p>
<pre><code>class Rate_My_Post_Custom_API {
public function __construct () {
add_action( 'rest_api_init', array( $this, 'create_update_rating_route' ) );
}
public function create_update_rating_route () {
register_rest_route( 'wp/v2', 'update-rmp', array(
'methods' => 'POST',
'callback' => function ( WP_REST_Request $request ) {
global $wpdb;
$request_body = json_decode( $request -> get_body() );
$rating_table = $wpdb -> prefix . "rmp_analytics";
$total_votes = get_post_meta( $request_body -> post_id, 'rmp_vote_count', true ) ? intval( get_post_meta( $request_body -> post_id, 'rmp_vote_count', true ) ) : 0;
$new_votes = $total_votes + 1;
$ratings_sum = get_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', true ) ? intval( get_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', true ) ) : 0;
$new_ratings_sum = $ratings_sum + $request_body -> vote;
$new_average = round( ( $new_ratings_sum / $new_votes ), 1 );
update_post_meta( $request_body -> post_id, 'rmp_vote_count', $new_votes );
update_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', $new_ratings_sum );
$rating_updated = $wpdb -> insert( $rating_table, array(
'time' => current_time( 'mysql' ),
'ip' => '-1',
'country' => '0',
'user' => $request_body -> user_id,
'post' => $request_body -> post_id,
'action' => '1',
'duration' => '1',
'average' => $new_average,
'votes' => $new_votes,
'value' => $request_body -> vote,
'token' => '-1',
) );
if ( $rating_updated ) :
return rest_ensure_response( 'New rating registered.' );
else :
return rest_ensure_response( 'Error in registering rating.' );
endif;
},
'permission_callback' => '__return_true'
) );
}
}
new Rate_My_Post_Custom_API();
</code></pre>
| [
{
"answer_id": 412970,
"author": "Jacob Peattie",
"author_id": 39152,
"author_profile": "https://wordpress.stackexchange.com/users/39152",
"pm_score": 3,
"selected": true,
"text": "<p>When registering a route with <code>register_rest_route()</code> you can provide a <code>permission_call... | 2023/01/18 | [
"https://wordpress.stackexchange.com/questions/412968",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/85556/"
] | I'm creating a new API route that allows me to update a plugin database entries on custom table from an external application (below the code). My code seems to work, but I need an advice on how to block requests that don't belong to my app, in order to prevent an arbitrary user that discovers the route and knows for example how to use postman could edit the database. I was thinking to put `get_http_origin()` on the top of the `register_rest_route` callback function, comparing the origin of the request with a fixed string I know being the legitimate application. Will it work? Is there a more proficient/correct method?
```
class Rate_My_Post_Custom_API {
public function __construct () {
add_action( 'rest_api_init', array( $this, 'create_update_rating_route' ) );
}
public function create_update_rating_route () {
register_rest_route( 'wp/v2', 'update-rmp', array(
'methods' => 'POST',
'callback' => function ( WP_REST_Request $request ) {
global $wpdb;
$request_body = json_decode( $request -> get_body() );
$rating_table = $wpdb -> prefix . "rmp_analytics";
$total_votes = get_post_meta( $request_body -> post_id, 'rmp_vote_count', true ) ? intval( get_post_meta( $request_body -> post_id, 'rmp_vote_count', true ) ) : 0;
$new_votes = $total_votes + 1;
$ratings_sum = get_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', true ) ? intval( get_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', true ) ) : 0;
$new_ratings_sum = $ratings_sum + $request_body -> vote;
$new_average = round( ( $new_ratings_sum / $new_votes ), 1 );
update_post_meta( $request_body -> post_id, 'rmp_vote_count', $new_votes );
update_post_meta( $request_body -> post_id, 'rmp_rating_val_sum', $new_ratings_sum );
$rating_updated = $wpdb -> insert( $rating_table, array(
'time' => current_time( 'mysql' ),
'ip' => '-1',
'country' => '0',
'user' => $request_body -> user_id,
'post' => $request_body -> post_id,
'action' => '1',
'duration' => '1',
'average' => $new_average,
'votes' => $new_votes,
'value' => $request_body -> vote,
'token' => '-1',
) );
if ( $rating_updated ) :
return rest_ensure_response( 'New rating registered.' );
else :
return rest_ensure_response( 'Error in registering rating.' );
endif;
},
'permission_callback' => '__return_true'
) );
}
}
new Rate_My_Post_Custom_API();
``` | When registering a route with `register_rest_route()` you can provide a `permission_callback` which is a function that checks whether the user has permission to use the endpoint. If only Administrator users should be able to use the endpoint then you can check for the `manage_options` capability in the callback, like this:
```
register_rest_route( 'myplugin/v1', 'update-rmp'', array(
'permission_callback' => function () {
return current_user_can( 'manage_options' );
},
) );
```
**Note:** Do not use `wp/v2` as the namespace. That namespace is for endpoints registered by WordPress itself. Third party themes and plugins should use their own namespace.
To make your API request as a user with the required privileges, sign in as that user and go to *Users > Profile* and look for the *Application Passwords* section. Add a new application password and copy the result. You can now use this password from your application using Basic Authentication:
```
curl --user "USERNAME:PASSWORD" -X POST https://example.com/wp-json/myplugin/v1/update-rmp
```
Just substitute `USERNAME` with your WordPress username, and `PASSWORD` with the application password. |
413,012 | <p>Im trying to trigger a configuration everytime I create a new subsite on multisite environment, like so:</p>
<pre><code>add_action('init', 'mgh_set_events_option', 99);
function mgh_set_events_option(){
$mgh_is_set_options = get_option('mgh_is_set_options');
if(!$mgh_is_set_options){
print_r('setting options');
update_option( 'mgh_is_set_options', true );
}
}
</code></pre>
<p>The problem is that the 'init' action does not trigger in some sites from our multisite instance. There is any principle of why this happens?</p>
| [
{
"answer_id": 413014,
"author": "Jacob Peattie",
"author_id": 39152,
"author_profile": "https://wordpress.stackexchange.com/users/39152",
"pm_score": 2,
"selected": false,
"text": "<p>The <code>init</code> hook will run whenever WordPress is loaded. So if you have a plugin or theme that... | 2023/01/19 | [
"https://wordpress.stackexchange.com/questions/413012",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/213490/"
] | Im trying to trigger a configuration everytime I create a new subsite on multisite environment, like so:
```
add_action('init', 'mgh_set_events_option', 99);
function mgh_set_events_option(){
$mgh_is_set_options = get_option('mgh_is_set_options');
if(!$mgh_is_set_options){
print_r('setting options');
update_option( 'mgh_is_set_options', true );
}
}
```
The problem is that the 'init' action does not trigger in some sites from our multisite instance. There is any principle of why this happens? | If your code is in a theme's `functions.php`, it'll only run on sites where that theme is active. You can ensure that it's active on *all* your sites by putting that code snippet into a [plugin](https://developer.wordpress.org/plugins/) that's active on every site (ie, Network Activated). Alternately, you can use a [Must-Use plugin](https://wordpress.org/support/article/must-use-plugins/) to ensure that it runs on every site in your Multisite network. |
413,029 | <p>I have created a taxonomy and in that taxonomy i have created custom field for image. Now I want to show that custom field image on my custom page template with category name. I have tried much it is not working.
My code is here below:</p>
<pre><code> <?php
// Template Name:Post By Category
get_header();
?>
<?php
// Get all the categories
$categories = get_terms( 'newcategory' );
// Loop through all the returned terms
foreach ( $categories as $category ):
// set up a new query for each category, pulling in related posts.
$services = new WP_Query(
array(
'post_type' => 'postlinks',
'showposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'newcategory',
'terms' => array( $category->slug ),
'field' => 'slug'
)
)
)
);
?>
<div class=" category_card-div d-lg-inline d-sm-block" stylle="height:450px;">
<div class=' p-0 text-white category_custom_card d-lg-inline-block d-sm-block'
style="border: 1px solid #fff;height:450px; border-radius :15px; overflow:hidden; background:#000;width: 22%;">
<div class='category_card_title bg-danger d-flex align-items-center justify-content-center'
style='height: 80px;'>
<h3 class='text-white text-center'>
<?php echo $category->name; ?>
<?php if( get_field('favicon') ): ?>
<img class="post-icons-custom" style='width: 25px; height: 25px;'
src="<?php echo get_the_field('favicon'); ?>" />
<?php endif; ?>
</h3>
</div>
<ul class=" custom-post-list">
<?php while ($services->have_posts()) : $services->the_post(); ?>
<li>
<?php if( get_field('favicon') ): ?>
<img class="post-icons-custom" style='width: 25px; height: 25px;'
src="<?php the_field('favicon'); ?>" />
<?php endif; ?>
<a class="text-white ml-2" href="<?php the_permalink(); ?>" sytle="hover:text-decoration: none;">
<?php the_title(); ?></a>
</li>
<?php endwhile; ?>
</ul>
</div>
</div>
<?php
// Reset things, for good measure
$services = null;
wp_reset_postdata();
// end the loop
endforeach;
?>
<?php get_footer(); ?>
</code></pre>
<p>Now i want to show like that in the image below:</p>
<p><a href="https://i.stack.imgur.com/bFs1r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bFs1r.png" alt="enter image description here" /></a></p>
| [
{
"answer_id": 413014,
"author": "Jacob Peattie",
"author_id": 39152,
"author_profile": "https://wordpress.stackexchange.com/users/39152",
"pm_score": 2,
"selected": false,
"text": "<p>The <code>init</code> hook will run whenever WordPress is loaded. So if you have a plugin or theme that... | 2023/01/20 | [
"https://wordpress.stackexchange.com/questions/413029",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229197/"
] | I have created a taxonomy and in that taxonomy i have created custom field for image. Now I want to show that custom field image on my custom page template with category name. I have tried much it is not working.
My code is here below:
```
<?php
// Template Name:Post By Category
get_header();
?>
<?php
// Get all the categories
$categories = get_terms( 'newcategory' );
// Loop through all the returned terms
foreach ( $categories as $category ):
// set up a new query for each category, pulling in related posts.
$services = new WP_Query(
array(
'post_type' => 'postlinks',
'showposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'newcategory',
'terms' => array( $category->slug ),
'field' => 'slug'
)
)
)
);
?>
<div class=" category_card-div d-lg-inline d-sm-block" stylle="height:450px;">
<div class=' p-0 text-white category_custom_card d-lg-inline-block d-sm-block'
style="border: 1px solid #fff;height:450px; border-radius :15px; overflow:hidden; background:#000;width: 22%;">
<div class='category_card_title bg-danger d-flex align-items-center justify-content-center'
style='height: 80px;'>
<h3 class='text-white text-center'>
<?php echo $category->name; ?>
<?php if( get_field('favicon') ): ?>
<img class="post-icons-custom" style='width: 25px; height: 25px;'
src="<?php echo get_the_field('favicon'); ?>" />
<?php endif; ?>
</h3>
</div>
<ul class=" custom-post-list">
<?php while ($services->have_posts()) : $services->the_post(); ?>
<li>
<?php if( get_field('favicon') ): ?>
<img class="post-icons-custom" style='width: 25px; height: 25px;'
src="<?php the_field('favicon'); ?>" />
<?php endif; ?>
<a class="text-white ml-2" href="<?php the_permalink(); ?>" sytle="hover:text-decoration: none;">
<?php the_title(); ?></a>
</li>
<?php endwhile; ?>
</ul>
</div>
</div>
<?php
// Reset things, for good measure
$services = null;
wp_reset_postdata();
// end the loop
endforeach;
?>
<?php get_footer(); ?>
```
Now i want to show like that in the image below:
[](https://i.stack.imgur.com/bFs1r.png) | If your code is in a theme's `functions.php`, it'll only run on sites where that theme is active. You can ensure that it's active on *all* your sites by putting that code snippet into a [plugin](https://developer.wordpress.org/plugins/) that's active on every site (ie, Network Activated). Alternately, you can use a [Must-Use plugin](https://wordpress.org/support/article/must-use-plugins/) to ensure that it runs on every site in your Multisite network. |
413,201 | <p>I'm new to WordPress development. I watched a video on how to add featured images. For some reason it's not working, and I can't really figure out why. The option for featured image is not showing at all. So I don't really know how to fix it.</p>
<p>I've tried Googling to see if people have experienced the same thing. From what I've seen, it's usually syntax errors. However, I don't think I have that.</p>
<ul>
<li>I've tried deleting and adding it on again, but to no avail.</li>
<li>I've also tried adding an array as a second argument to <code>add_theme_support</code>, but still nothing.</li>
<li>I've also tried having the <code>add_actions</code> function before the custom function. That hasn't worked either.</li>
<li>In addition to that, I tried just having the <code>add_theme_support</code> without the <code>add_action</code>, but again nothing.</li>
</ul>
<p>Here is the code in the <code>functions.php</code> file:</p>
<pre class="lang-php prettyprint-override"><code>`add_action( 'after_setup_theme', 'Image_theme_setup' );
function Image_theme_setup() {
add_theme_support( 'post-thumbnails' );
}`
</code></pre>
| [
{
"answer_id": 413014,
"author": "Jacob Peattie",
"author_id": 39152,
"author_profile": "https://wordpress.stackexchange.com/users/39152",
"pm_score": 2,
"selected": false,
"text": "<p>The <code>init</code> hook will run whenever WordPress is loaded. So if you have a plugin or theme that... | 2023/01/26 | [
"https://wordpress.stackexchange.com/questions/413201",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229434/"
] | I'm new to WordPress development. I watched a video on how to add featured images. For some reason it's not working, and I can't really figure out why. The option for featured image is not showing at all. So I don't really know how to fix it.
I've tried Googling to see if people have experienced the same thing. From what I've seen, it's usually syntax errors. However, I don't think I have that.
* I've tried deleting and adding it on again, but to no avail.
* I've also tried adding an array as a second argument to `add_theme_support`, but still nothing.
* I've also tried having the `add_actions` function before the custom function. That hasn't worked either.
* In addition to that, I tried just having the `add_theme_support` without the `add_action`, but again nothing.
Here is the code in the `functions.php` file:
```php
`add_action( 'after_setup_theme', 'Image_theme_setup' );
function Image_theme_setup() {
add_theme_support( 'post-thumbnails' );
}`
``` | If your code is in a theme's `functions.php`, it'll only run on sites where that theme is active. You can ensure that it's active on *all* your sites by putting that code snippet into a [plugin](https://developer.wordpress.org/plugins/) that's active on every site (ie, Network Activated). Alternately, you can use a [Must-Use plugin](https://wordpress.org/support/article/must-use-plugins/) to ensure that it runs on every site in your Multisite network. |
413,269 | <p>I've submitted a plugin for review and it was not accepted for the following reason:</p>
<h2>Calling file locations poorly</h2>
<p>The way your plugin is referencing other files is not going to work with all setups of WordPress.</p>
<p>When you hardcode in paths like wp-content or your plugin folder name, or assume that everyone has WordPress in the root of their domain, you cause anyone using 'Giving WordPress it's own directory' (a VERY common setup) to break. In addition, WordPress allows users to change the name of wp-content, so you would break anyone who chooses to do so.</p>
<p>Please review the following link and update your plugin accordingly. And don't worry about supporting WordPress 2.x or lower. We don't encourage it nor expect you to do so, so save yourself some time and energy.</p>
<ul>
<li><a href="https://developer.wordpress.org/plugins/plugin-basics/determining-plugin-and-content-directories/" rel="nofollow noreferrer">https://developer.wordpress.org/plugins/plugin-basics/determining-plugin-and-content-directories/</a></li>
</ul>
<p>Remember to make use of the <strong>FILE</strong> variable, in order than your plugin function properly in the real world.</p>
<p>Example(s) from your plugin:</p>
<pre><code>require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/single-post-ajax-callback.php';
require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/generate-images-ajax-callback.php';
require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/add-image-to-library-ajax-callback.php';
</code></pre>
<p>I don't understand why this isn't acceptable since I'm not hardcoding the 'wp-content' path, and I'm using the WP_PLUGIN_DIR constant.</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 413271,
"author": "Pat J",
"author_id": 16121,
"author_profile": "https://wordpress.stackexchange.com/users/16121",
"pm_score": 3,
"selected": true,
"text": "<p>Perhaps they'd prefer that you use <a href=\"https://developer.wordpress.org/reference/functions/plugin_dir_path... | 2023/01/27 | [
"https://wordpress.stackexchange.com/questions/413269",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229469/"
] | I've submitted a plugin for review and it was not accepted for the following reason:
Calling file locations poorly
-----------------------------
The way your plugin is referencing other files is not going to work with all setups of WordPress.
When you hardcode in paths like wp-content or your plugin folder name, or assume that everyone has WordPress in the root of their domain, you cause anyone using 'Giving WordPress it's own directory' (a VERY common setup) to break. In addition, WordPress allows users to change the name of wp-content, so you would break anyone who chooses to do so.
Please review the following link and update your plugin accordingly. And don't worry about supporting WordPress 2.x or lower. We don't encourage it nor expect you to do so, so save yourself some time and energy.
* <https://developer.wordpress.org/plugins/plugin-basics/determining-plugin-and-content-directories/>
Remember to make use of the **FILE** variable, in order than your plugin function properly in the real world.
Example(s) from your plugin:
```
require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/single-post-ajax-callback.php';
require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/generate-images-ajax-callback.php';
require_once WP_PLUGIN_DIR.'/pluginname/inc/functions/add-image-to-library-ajax-callback.php';
```
I don't understand why this isn't acceptable since I'm not hardcoding the 'wp-content' path, and I'm using the WP\_PLUGIN\_DIR constant.
Thanks in advance. | Perhaps they'd prefer that you use [`plugin_dir_path()`](https://developer.wordpress.org/reference/functions/plugin_dir_path/).
```
require_once(
plugin_dir_path( __FILE__ )
. 'inc/functions/single-post-ajax-callback.php'
);
```
...etc. |
413,309 | <p>I am using WP Multisite to create subsites for paid users. A user will pay for a subsite on a yearly subscription basis. The subscription will renew automatically. But if the user doesn't renew, then the subsite needs to be disabled or made inactive.</p>
<p>I think that I will have to create a plugin that has a setting that indicates the subsite expiration date in two places:</p>
<p>The plugin should modify the site list (shown via the <code>sites.php</code> page) to show the expiration (or renewal) dates.</p>
<p>The plugin needs to add a field to the individual site editing screen (<code>site-info.php</code>) to show the expiration date</p>
<p>I assume that there are some filters for those two items, but need guidance as to where to start looking. (Unless there is a plugin that already has this functionality - I haven't found one yet.)</p>
| [
{
"answer_id": 413325,
"author": "Adnan Malik",
"author_id": 229553,
"author_profile": "https://wordpress.stackexchange.com/users/229553",
"pm_score": 0,
"selected": false,
"text": "<p>yes you have to write code snippet or plugin that adds status field that type is boolen in wp_users tab... | 2023/01/29 | [
"https://wordpress.stackexchange.com/questions/413309",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/29416/"
] | I am using WP Multisite to create subsites for paid users. A user will pay for a subsite on a yearly subscription basis. The subscription will renew automatically. But if the user doesn't renew, then the subsite needs to be disabled or made inactive.
I think that I will have to create a plugin that has a setting that indicates the subsite expiration date in two places:
The plugin should modify the site list (shown via the `sites.php` page) to show the expiration (or renewal) dates.
The plugin needs to add a field to the individual site editing screen (`site-info.php`) to show the expiration date
I assume that there are some filters for those two items, but need guidance as to where to start looking. (Unless there is a plugin that already has this functionality - I haven't found one yet.) | Since my need is two-fold, I found these answers here with a bit more searching.
1. To add to the Edit Site page, the best option is to add another 'tab' to that page. I found an answer here: [Add site options UI in Multisite Sites > Infos page](https://wordpress.stackexchange.com/questions/103765/add-site-options-ui-in-multisite-sites-infos-page) , which referenced a tutorial by one of the answerers: <https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html> (tutorial updated Dec 2022).
Using that tutorial as the basis, I was able to add my own tab to the Edit Site page, where I used update\_option to save my own options to that site.
2. To add a column to the Sites page, I found guidance here [Add new column to sites page](https://wordpress.stackexchange.com/questions/30431/add-new-column-to-sites-page) , which referenced code on GitHub that I used as a starting point <https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0>
That code is as follows, which I modified for my needs:
```
/* Add site_name as a column */
add_filter( 'wpmu_blogs_columns', 'add_useful_columns' );
function add_useful_columns( $site_columns ) {
$site_columns['site_name'] = 'Site Name';
return $site_columns;
}
/* Populate site_name with blogs site_name */
add_action( 'manage_sites_custom_column', 'column_site_name' , 10, 2 );
function column_site_name( $column_name, $blog_id ) {
$current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) );
echo ucwords( $current_blog_details->blogname );
}
```
With the above guidance, I was able to add my own settings tab, and then view settings in the Sites page. |
413,426 | <p>I want to start a new website and chose wordpress as my cmd, but im having a restriction. The website is all about api request to other websites and i triedto get an api to test it as an example. After writing in php and add it to code snippet i got an error. I went through wordpress developers documentation and found out how to make an external api request, i did the same in the code snippet but still didn't work. So decided to code a php file and upload it into the wordpress directory, but before doing this, o decided to ask for help. About how to make and external api request from a wordpress website, where and how to input the code and use the api on a page or post?</p>
<p>This is the api i tried to use for test:
'''
curl --location --request POST 'https://api.apyhub.com/data/convert/currency' <br />
--header 'Content-Type: application/json' <br />
--header 'apy-token: APT03xPn2ZVq7rFriUtRoamaY9Ucg1c7y17CPd60WtMW03' <br />
--data-raw '{
"source":"eur",
"target":"inr"
}'
'''</p>
<p>And i also tried using postman and it worked.</p>
<p>Please help.</p>
| [
{
"answer_id": 413325,
"author": "Adnan Malik",
"author_id": 229553,
"author_profile": "https://wordpress.stackexchange.com/users/229553",
"pm_score": 0,
"selected": false,
"text": "<p>yes you have to write code snippet or plugin that adds status field that type is boolen in wp_users tab... | 2023/02/01 | [
"https://wordpress.stackexchange.com/questions/413426",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229629/"
] | I want to start a new website and chose wordpress as my cmd, but im having a restriction. The website is all about api request to other websites and i triedto get an api to test it as an example. After writing in php and add it to code snippet i got an error. I went through wordpress developers documentation and found out how to make an external api request, i did the same in the code snippet but still didn't work. So decided to code a php file and upload it into the wordpress directory, but before doing this, o decided to ask for help. About how to make and external api request from a wordpress website, where and how to input the code and use the api on a page or post?
This is the api i tried to use for test:
'''
curl --location --request POST 'https://api.apyhub.com/data/convert/currency'
--header 'Content-Type: application/json'
--header 'apy-token: APT03xPn2ZVq7rFriUtRoamaY9Ucg1c7y17CPd60WtMW03'
--data-raw '{
"source":"eur",
"target":"inr"
}'
'''
And i also tried using postman and it worked.
Please help. | Since my need is two-fold, I found these answers here with a bit more searching.
1. To add to the Edit Site page, the best option is to add another 'tab' to that page. I found an answer here: [Add site options UI in Multisite Sites > Infos page](https://wordpress.stackexchange.com/questions/103765/add-site-options-ui-in-multisite-sites-infos-page) , which referenced a tutorial by one of the answerers: <https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html> (tutorial updated Dec 2022).
Using that tutorial as the basis, I was able to add my own tab to the Edit Site page, where I used update\_option to save my own options to that site.
2. To add a column to the Sites page, I found guidance here [Add new column to sites page](https://wordpress.stackexchange.com/questions/30431/add-new-column-to-sites-page) , which referenced code on GitHub that I used as a starting point <https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0>
That code is as follows, which I modified for my needs:
```
/* Add site_name as a column */
add_filter( 'wpmu_blogs_columns', 'add_useful_columns' );
function add_useful_columns( $site_columns ) {
$site_columns['site_name'] = 'Site Name';
return $site_columns;
}
/* Populate site_name with blogs site_name */
add_action( 'manage_sites_custom_column', 'column_site_name' , 10, 2 );
function column_site_name( $column_name, $blog_id ) {
$current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) );
echo ucwords( $current_blog_details->blogname );
}
```
With the above guidance, I was able to add my own settings tab, and then view settings in the Sites page. |
413,443 | <p>I used many user signup plugins for users registration and they did good job, but the problem is, each website collects different data through user registration forms. In my case, the data collected was stored partially in the users table in the database. For example, I want the users to mention their institute but I find this data nowhere in the database later.
How do I create a fully functional user registration system in WordPress? I I can do a bit of PHP programming if that can help.</p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/02 | [
"https://wordpress.stackexchange.com/questions/413443",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/198772/"
] | I used many user signup plugins for users registration and they did good job, but the problem is, each website collects different data through user registration forms. In my case, the data collected was stored partially in the users table in the database. For example, I want the users to mention their institute but I find this data nowhere in the database later.
How do I create a fully functional user registration system in WordPress? I I can do a bit of PHP programming if that can help. | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,480 | <p>I am currently trying to create a Wordpress plugin which create posts in the Wordpress database based on data from an external JSON API. As an example this NewsAPI feed could be used:</p>
<p><a href="https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=81143272da6c48d58bc38fe80dd110d6" rel="nofollow noreferrer">https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=81143272da6c48d58bc38fe80dd110d6</a></p>
<p>The plugin I have written decodes the JSON data by using <code>json_decode</code> and loops through the <code>article</code> object in the JSON feed. Finally, the posts is being inserted programmatically using <code>wp_insert_post</code>:</p>
<pre><code><?php
/**
* Plugin Name: Automatic News Feed Importer
* Version: 1.0.0
*/
function news_importer() {
$url = "https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=81143272da6c48d58bc38fe80dd110d6";
$response = wp_remote_get( $url );
$data = json_decode( wp_remote_retrieve_body( $response ) );
foreach( $data->articles as $news ) {
$post_title = $news->title;
$post_content = $news->content;
$post_date = $news->publishedAt;
$post = array(
'post_title' => $post_title,
'post_content' => $post_content,
'post_date' => $post_date,
'post_status' => 'publish',
'post_type' => 'post'
);
wp_insert_post( $post );
}
}
</code></pre>
<p>My problem is that when the plugin is activated, no posts are creating and added to the database. When a new post is uploaded and appearing in the feed it has to be uploaded automatically (asynchronously).</p>
<p>Any ideas on why this isn't working?</p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/03 | [
"https://wordpress.stackexchange.com/questions/413480",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/226366/"
] | I am currently trying to create a Wordpress plugin which create posts in the Wordpress database based on data from an external JSON API. As an example this NewsAPI feed could be used:
<https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=81143272da6c48d58bc38fe80dd110d6>
The plugin I have written decodes the JSON data by using `json_decode` and loops through the `article` object in the JSON feed. Finally, the posts is being inserted programmatically using `wp_insert_post`:
```
<?php
/**
* Plugin Name: Automatic News Feed Importer
* Version: 1.0.0
*/
function news_importer() {
$url = "https://newsapi.org/v2/top-headlines?sources=techcrunch&apiKey=81143272da6c48d58bc38fe80dd110d6";
$response = wp_remote_get( $url );
$data = json_decode( wp_remote_retrieve_body( $response ) );
foreach( $data->articles as $news ) {
$post_title = $news->title;
$post_content = $news->content;
$post_date = $news->publishedAt;
$post = array(
'post_title' => $post_title,
'post_content' => $post_content,
'post_date' => $post_date,
'post_status' => 'publish',
'post_type' => 'post'
);
wp_insert_post( $post );
}
}
```
My problem is that when the plugin is activated, no posts are creating and added to the database. When a new post is uploaded and appearing in the feed it has to be uploaded automatically (asynchronously).
Any ideas on why this isn't working? | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,508 | <p>I have just migrated my website from hostinger to hostinger manually. And now when I upload any picture on my website the photos getting corrupted automatically. Although the picture was shown on my hosting but I am not able to use picture on my website.</p>
<p>my website link - <a href="https://sablog.in/" rel="nofollow noreferrer">https://sablog.in/</a></p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/04 | [
"https://wordpress.stackexchange.com/questions/413508",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229716/"
] | I have just migrated my website from hostinger to hostinger manually. And now when I upload any picture on my website the photos getting corrupted automatically. Although the picture was shown on my hosting but I am not able to use picture on my website.
my website link - <https://sablog.in/> | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,514 | <p>this question was already similar asked but I don't find a way to get it working without using a plugin. So basically I got a text on my homepage which says login, so it's a normal text which i want to change to "my account" if a user is logged in. Also then the link has to change. I thought about creating 2 divs and hide one via css wether a user is logged in or not but this seems pretty inefficient and non-responsive to me. I would like to do it on my own but since I'm pretty new to php, I don't know how to do it.</p>
<p>Tnaks in advance</p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/04 | [
"https://wordpress.stackexchange.com/questions/413514",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229720/"
] | this question was already similar asked but I don't find a way to get it working without using a plugin. So basically I got a text on my homepage which says login, so it's a normal text which i want to change to "my account" if a user is logged in. Also then the link has to change. I thought about creating 2 divs and hide one via css wether a user is logged in or not but this seems pretty inefficient and non-responsive to me. I would like to do it on my own but since I'm pretty new to php, I don't know how to do it.
Tnaks in advance | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,522 | <p>I've tried everything I can think of and read about. I cannot seem to figure out why this doesn't work, let alone get it to work. I have a Custom post type called Talk. That custom post type has a custom taxonomy (non-hierarchical) of Speaker. The taxonomy Speaker has three Advanced Custom Fields added to it: Institution, Phone, Email.</p>
<p>A Gravity Form using the Advanced Post Creation add-on creates a Talk as a draft. The speaker name, institution, phone and email are all fields on that form. Below is the latest version of my attempts to have the Speaker ACF update after post creation.</p>
<pre><code>add_action( 'gform_advancedpostcreation_post_after_creation_2', 'after_post_creation', 10, 4 );
function after_post_creation( $post_id, $feed, $entry, $form ){
$spkr_inst = rgar( $entry, '3' );
$spkr_ph = rgar( $entry, '10' );
$spkr_em = rgar( $entry, '11' );
$talk_speakers = get_the_terms( $post_id, 'talk_speaker' );
foreach($talk_speakers as $talk_speaker) {
$spkr_id = 'speaker_'.$talk_speaker->term_id;
GFCommon::send_email( 'a@b.com', 'a@b.com','','','New Post', $spkr_id);
// update_field( 'speaker_institution', $spkr_inst, 'speaker_'.$talk_speaker->term_id);
// update_field( 'speaker_phone_number', $spkr_ph, 'speaker_'.$talk_speaker->term_id);
// update_field( 'speaker_email_address', $spkr_em, 'speaker_'.$talk_speaker->term_id);
}
}
</code></pre>
<p>The commented out update_field stuff NEVER happens, whether I'm using <code>'speaker_'.$talk_speaker->term_id</code> or the above <code>$spkr_id</code>.
But the test email sends, and has the correct $spkr_id value in the email body, speaker_112 ...</p>
<p>I've read through these (but far be it from me to assume I missed nothing ...):</p>
<p><a href="https://www.advancedcustomfields.com/resources/update_field/#update-a-value-from-different-objects" rel="nofollow noreferrer">https://www.advancedcustomfields.com/resources/update_field/#update-a-value-from-different-objects</a></p>
<p><a href="https://docs.gravityforms.com/gform_advancedpostcreation_post_after_creation/#examples" rel="nofollow noreferrer">https://docs.gravityforms.com/gform_advancedpostcreation_post_after_creation/#examples</a></p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/05 | [
"https://wordpress.stackexchange.com/questions/413522",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/78660/"
] | I've tried everything I can think of and read about. I cannot seem to figure out why this doesn't work, let alone get it to work. I have a Custom post type called Talk. That custom post type has a custom taxonomy (non-hierarchical) of Speaker. The taxonomy Speaker has three Advanced Custom Fields added to it: Institution, Phone, Email.
A Gravity Form using the Advanced Post Creation add-on creates a Talk as a draft. The speaker name, institution, phone and email are all fields on that form. Below is the latest version of my attempts to have the Speaker ACF update after post creation.
```
add_action( 'gform_advancedpostcreation_post_after_creation_2', 'after_post_creation', 10, 4 );
function after_post_creation( $post_id, $feed, $entry, $form ){
$spkr_inst = rgar( $entry, '3' );
$spkr_ph = rgar( $entry, '10' );
$spkr_em = rgar( $entry, '11' );
$talk_speakers = get_the_terms( $post_id, 'talk_speaker' );
foreach($talk_speakers as $talk_speaker) {
$spkr_id = 'speaker_'.$talk_speaker->term_id;
GFCommon::send_email( 'a@b.com', 'a@b.com','','','New Post', $spkr_id);
// update_field( 'speaker_institution', $spkr_inst, 'speaker_'.$talk_speaker->term_id);
// update_field( 'speaker_phone_number', $spkr_ph, 'speaker_'.$talk_speaker->term_id);
// update_field( 'speaker_email_address', $spkr_em, 'speaker_'.$talk_speaker->term_id);
}
}
```
The commented out update\_field stuff NEVER happens, whether I'm using `'speaker_'.$talk_speaker->term_id` or the above `$spkr_id`.
But the test email sends, and has the correct $spkr\_id value in the email body, speaker\_112 ...
I've read through these (but far be it from me to assume I missed nothing ...):
<https://www.advancedcustomfields.com/resources/update_field/#update-a-value-from-different-objects>
<https://docs.gravityforms.com/gform_advancedpostcreation_post_after_creation/#examples> | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,547 | <p>I am quite new to wordpress and I'd like to know what I am doing wrong here:</p>
<p>I've created a custom post type, let's say, custom_post_type_jobs.</p>
<p>And I have a page which is called jobs.</p>
<p>When I create a custom post type post, it has a permalink like this: .../custom_post_type_jobs/post-title.</p>
<p>Since I have a shortcode on the page "jobs", which renders some stuff, I would like to render the posts there and when clicking them I want a structure as follows: /jobs/post-title.</p>
<p>Am I missing here something?</p>
<p>When creating the custom post type, I gave it the args:</p>
<pre><code>'rewrites' => array(
'slug' => 'jobs'
),
</code></pre>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/05 | [
"https://wordpress.stackexchange.com/questions/413547",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229736/"
] | I am quite new to wordpress and I'd like to know what I am doing wrong here:
I've created a custom post type, let's say, custom\_post\_type\_jobs.
And I have a page which is called jobs.
When I create a custom post type post, it has a permalink like this: .../custom\_post\_type\_jobs/post-title.
Since I have a shortcode on the page "jobs", which renders some stuff, I would like to render the posts there and when clicking them I want a structure as follows: /jobs/post-title.
Am I missing here something?
When creating the custom post type, I gave it the args:
```
'rewrites' => array(
'slug' => 'jobs'
),
``` | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,555 | <p>I'm building out an index page of posts that are grouped under multiple categories, but those categories are all under the same umbrella parent category.</p>
<p>I'd like to have these posts displayed alphabetically by default.</p>
<p>I've found functions that work to change the post order globally on my site, but I'd like to find a function that works to ONLY sort posts alphabetically based on either the post ID of this index page or the parent category ID.</p>
<p>I'm using a Divi child theme if that matters for anything.</p>
| [
{
"answer_id": 413542,
"author": "Jaimee Page",
"author_id": 163137,
"author_profile": "https://wordpress.stackexchange.com/users/163137",
"pm_score": 1,
"selected": false,
"text": "<p>Ultimate Member is generally one of the most popular ones to use, creating a user registration form man... | 2023/02/06 | [
"https://wordpress.stackexchange.com/questions/413555",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/228545/"
] | I'm building out an index page of posts that are grouped under multiple categories, but those categories are all under the same umbrella parent category.
I'd like to have these posts displayed alphabetically by default.
I've found functions that work to change the post order globally on my site, but I'd like to find a function that works to ONLY sort posts alphabetically based on either the post ID of this index page or the parent category ID.
I'm using a Divi child theme if that matters for anything. | You would want to create a custom registration form with HTML and send it to a PHP function that creates the user and then adds user meta data.
For example, the form:
```
<form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post">
<!-- TODO: add a nonce in here -->
<!-- this "action" pipes it through to the correct place -->
<input type="hidden" name="action" value="custom_registration">
<input type="text" name="username" />
<input type="text" name="email" />
<input type="text" name="institute" />
<input type="password" name="password" />
<input type="submit" value="Register" />
</form>
```
This is just an example, in reality you would want to add extra validation and nonce to prevent any naughty business. This was just the basic form idea.
Then in your functions.php file to receive the form you make a hook using `add_action()`, where the first parameter uses the format `admin_post_nopriv_`+[action]. The `nopriv` means that this is for non-logged in users to execute functions (which a user who is registering most likely would not be logged in)
This [action] needs to match the value of the hidden action field in our HTML form. Since we called it `custom_registration` then the hook would be `admin_post_nopriv_custom_registration`:
```
add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is "admin_post_nopriv_" + [the hidden action you put in the html form]
function custom_make_new_user(){
// TODO: validate the nonce before continuing
// TODO: validate that all incoming POST data is OK
$user = $_POST['username']; // potentially sanitize these
$pass = $_POST['password']; // potentially sanitize these
$email = $_POST['email']; // potentially sanitize these
$institute = $_POST['institute']; // potentially sanitize these
$user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID
if($user_id){ // if the user exists/if creating was successful.
$user = new WP_User( $user_id ); // load the new user
$user->set_role('subscriber'); // give the new user a role, in this case a subscriber
// now add your custom user meta for each data point
update_user_meta($user_id, 'institute', $institute);
wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.
}else{
// user wasn't made
}
}
```
That should do the trick. You could add any other user data you wanted by adding extra `update_user_meta();` - the first param is the user\_id, second param is the meta\_key, third param is the meta value. The neat thing about `update_user_meta()` is that if it didn't exist already it will make it, otherwise it will update an existing value.
Then to retrieve this data anywhere, you would write this:
```
$user_institute = get_user_meta($user_id, 'institute', true);
```
The third parameter of `get_user_meta` is useful because without it, or with it set to false by default, you would receive an array but with it set to true it returns a single value ready to use.
Hope that helps! |
413,694 | <p><strong>Using input_attrs() Multiple Times Within One Customizer Control</strong>.</p>
<p>I want to be able to use the function <code>input_attrs()</code>
<a href="https://developer.wordpress.org/reference/classes/wp_customize_control/input_attrs/" rel="nofollow noreferrer">https://developer.wordpress.org/reference/classes/wp_customize_control/input_attrs/</a></p>
<p>With this type of code <code>$this->input_attrs()</code> And I want to be able to use the function multiple times...</p>
<p>Example 1:</p>
<p><code><input type="text" value="blah1" <?php $this->input_attrs($1); ?>></code></p>
<p><code><input type="text" value="blah2" <?php $this->input_attrs($2); ?>></code></p>
<p>The first example is not correct php. Do you know how to write this correctly?</p>
<p>Example 2:</p>
<p><code><input type="text" value="blah1" <?php $this->input_attrs(); ?>></code></p>
<p><code><input type="text" value="blah2" <?php $this->input_attrs_2(); ?>></code></p>
<p>If I do end up using a <code>input_attrs_2()</code> Do I also need my own function <code>get_input_attrs_2()</code> ?</p>
| [
{
"answer_id": 413699,
"author": "Harrison",
"author_id": 208138,
"author_profile": "https://wordpress.stackexchange.com/users/208138",
"pm_score": 1,
"selected": false,
"text": "<p>You shouldn't need to call the input_attrs() method directly. Instead, rely on the <a href=\"https://devel... | 2023/02/09 | [
"https://wordpress.stackexchange.com/questions/413694",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/210387/"
] | **Using input\_attrs() Multiple Times Within One Customizer Control**.
I want to be able to use the function `input_attrs()`
<https://developer.wordpress.org/reference/classes/wp_customize_control/input_attrs/>
With this type of code `$this->input_attrs()` And I want to be able to use the function multiple times...
Example 1:
`<input type="text" value="blah1" <?php $this->input_attrs($1); ?>>`
`<input type="text" value="blah2" <?php $this->input_attrs($2); ?>>`
The first example is not correct php. Do you know how to write this correctly?
Example 2:
`<input type="text" value="blah1" <?php $this->input_attrs(); ?>>`
`<input type="text" value="blah2" <?php $this->input_attrs_2(); ?>>`
If I do end up using a `input_attrs_2()` Do I also need my own function `get_input_attrs_2()` ? | You shouldn't need to call the input\_attrs() method directly. Instead, rely on the [add\_control()](https://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/) method of the wordpress customizer object to generate the html inputs for your customizer settings. The `add_control()` method takes as its second argument an array of properties that allows you to set the label for the input, the section of the customizer where the input will be found, the type of input (text, checkbox, <select>, etc.), and more. A complete list of properties you can set via the second argument of add\_control() can be found [here](https://developer.wordpress.org/reference/classes/wp_customize_control/__construct/). One of them is `input_attrs`. If you pass this property an array of name/value pairs, `add_control()` will include them as custom attributes and values on the html inputs it generates.
As a loose example of what this might look like when you put it all together:
```
add_action( 'customize_register', 'mytheme_customize_register');
function mytheme_customize_register( $wp_customize ) {
$wp_customize->add_setting( 'mytheme_mysetting', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
) );
$wp_customize->add_control( 'mytheme_mysetting', array(
'label' => __( 'My website user of the month', 'mytheme-textdomain' ),
'type' => 'text',
'section' => 'mysection',
'input_attrs' => array(
'my-custom-attribute-name' => 'my custom attribute value',
'foo' => 'bar'
)
));
}
``` |
413,714 | <p>I have a <strong>custom post type</strong> - <em><strong>Demo Tours</strong></em></p>
<p>And for that <strong>CPT</strong> I created a <strong>Custom Taxonomy</strong> - <em><strong>Demo Tour Categories.</strong></em>
Each Demo Tour may have one or more category.
Each category has Custom Field - Category Image/Video</p>
<p>On front end, the query gets all the custom taxonomy entries (Tour Categories) display the category Image and Description on the left, and the Demo Tours that belong to that category listed on the right.
Pretty basic and works like a charm.</p>
<p>The problem is, I must control the list order of Demo categories (and the demo tours that belong to them).
Now the orderby is by their ID.</p>
<p>But I want to add a Custom field - Order Number to Custom Taxonomy - Demo Categories, and on front end I want to display them depending on the Order Number.</p>
<p>Custom Fields created with ACF plugin
and the Custom Post Types created with Pods Admin plugin.</p>
<p>I have really spent a significant time on web to find a solution but nothing matches exactly what I need.</p>
<p>I believe the problem is my approach but can't really put my finger on the problem.</p>
<p>Please show me a way :)</p>
<p><strong>Here is my code : (briefly)</strong></p>
<p><strong>first I get the terms :</strong></p>
<pre><code>$terms = get_terms(
array(
'taxonomy' => 'tour_category',
'hide_empty' => true,
)
);
</code></pre>
<p><strong>then I loop them to show a header with Category names (like a menu)</strong></p>
<pre><code> foreach($terms as $term) {
echo ' <a class="demo_cat_link" href="#' . $term->slug . '">' . $term->name . '<li class="demo_cat"></li></a>';
}
</code></pre>
<p><strong>then I display the categories on the left</strong></p>
<pre><code> $i = 0;
foreach ($terms as $terms => $term) {
$i++ != 0 ? $fClass = "fade" : $fClass = "" ;
$cat_id = $term->term_id;
$cat_video = get_field('featured_video', $term->taxonomy . '_' . $term->term_id );
$cat_order = get_field('tour_category_list_order', $term->taxonomy . '_' . $term->term_id );
<div class="loop_left_section">
<div class="tour_cat_thumb <?=$fClass?>">
<video class="demo_featured" width="620" autoplay="autoplay" loop="loop" muted="">
<source type="video/mp4" src="<?php echo $cat_video; ?>">
</video>
</div> <? // tour_cat_thumb ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
</div> <? // loop_left_section ?>
</code></pre>
<p><strong>and the demo tours on the right</strong></p>
<pre><code><div class="loop_right_section">
<?php
$args = array(
'post_type' => 'demotours',
'tax_query' => array(
array(
'taxonomy' => 'tour_category',
'field' => 'slug',
'terms' => $term->slug,
),
),
);
$loop = new WP_Query($args);
if($loop->have_posts()) {
while($loop->have_posts()) : $loop->the_post();
$demo_tour_link = ( get_field('demo_tour_link', get_the_ID() ) ? get_field('demo_tour_link', get_the_ID() ) : "#" );
echo '<a href="'.$demo_tour_link.'" class="tour_link">
<div class="demo_tour_wrap">
<h3>' . get_the_title() . '</h3>
<p>'. get_the_excerpt() . '</p>
</div>
</a>';
endwhile;
}
?>
</div> <? // loop_right_section ?>
</code></pre>
| [
{
"answer_id": 413758,
"author": "strangedenial",
"author_id": 229892,
"author_profile": "https://wordpress.stackexchange.com/users/229892",
"pm_score": 0,
"selected": false,
"text": "<p>Thanks to <code>Tom J Nowell</code> I found the solution. It was so simple that I felt a little shame... | 2023/02/10 | [
"https://wordpress.stackexchange.com/questions/413714",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229892/"
] | I have a **custom post type** - ***Demo Tours***
And for that **CPT** I created a **Custom Taxonomy** - ***Demo Tour Categories.***
Each Demo Tour may have one or more category.
Each category has Custom Field - Category Image/Video
On front end, the query gets all the custom taxonomy entries (Tour Categories) display the category Image and Description on the left, and the Demo Tours that belong to that category listed on the right.
Pretty basic and works like a charm.
The problem is, I must control the list order of Demo categories (and the demo tours that belong to them).
Now the orderby is by their ID.
But I want to add a Custom field - Order Number to Custom Taxonomy - Demo Categories, and on front end I want to display them depending on the Order Number.
Custom Fields created with ACF plugin
and the Custom Post Types created with Pods Admin plugin.
I have really spent a significant time on web to find a solution but nothing matches exactly what I need.
I believe the problem is my approach but can't really put my finger on the problem.
Please show me a way :)
**Here is my code : (briefly)**
**first I get the terms :**
```
$terms = get_terms(
array(
'taxonomy' => 'tour_category',
'hide_empty' => true,
)
);
```
**then I loop them to show a header with Category names (like a menu)**
```
foreach($terms as $term) {
echo ' <a class="demo_cat_link" href="#' . $term->slug . '">' . $term->name . '<li class="demo_cat"></li></a>';
}
```
**then I display the categories on the left**
```
$i = 0;
foreach ($terms as $terms => $term) {
$i++ != 0 ? $fClass = "fade" : $fClass = "" ;
$cat_id = $term->term_id;
$cat_video = get_field('featured_video', $term->taxonomy . '_' . $term->term_id );
$cat_order = get_field('tour_category_list_order', $term->taxonomy . '_' . $term->term_id );
<div class="loop_left_section">
<div class="tour_cat_thumb <?=$fClass?>">
<video class="demo_featured" width="620" autoplay="autoplay" loop="loop" muted="">
<source type="video/mp4" src="<?php echo $cat_video; ?>">
</video>
</div> <? // tour_cat_thumb ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
</div> <? // loop_left_section ?>
```
**and the demo tours on the right**
```
<div class="loop_right_section">
<?php
$args = array(
'post_type' => 'demotours',
'tax_query' => array(
array(
'taxonomy' => 'tour_category',
'field' => 'slug',
'terms' => $term->slug,
),
),
);
$loop = new WP_Query($args);
if($loop->have_posts()) {
while($loop->have_posts()) : $loop->the_post();
$demo_tour_link = ( get_field('demo_tour_link', get_the_ID() ) ? get_field('demo_tour_link', get_the_ID() ) : "#" );
echo '<a href="'.$demo_tour_link.'" class="tour_link">
<div class="demo_tour_wrap">
<h3>' . get_the_title() . '</h3>
<p>'. get_the_excerpt() . '</p>
</div>
</a>';
endwhile;
}
?>
</div> <? // loop_right_section ?>
``` | Use `usort` with a custom callback, like this:
```php
function compare_term_order_numbers( \WP_Term $a, \WP_Term $b ) : int {
$order_number_a = get_field( 'order_number', $a );
$order_number_b = get_field( 'order_number', $b );
return strcmp( $order_number_a, $order_number_b );
}
usort($terms, 'compare_terms' );
```
Note that this assumes `get_field` returns a plain string, not an object, that each term has the `order_number` set and it isn't empty, and that `$terms` is an array of terms, not an error object or `false`/`null`.
More information at: <https://www.php.net/manual/en/function.usort.php> |
413,842 | <p>I did this all the time pre-full-site-editing, back when we all built menus under Appearance. But without the Menu option under Appearance anymore, how do I do this?</p>
<p>Is it only possible by way of a home-rolled function in functions.php or in javascript?
I tried a function under <code>add_filter( 'wp_nav_menu_items', 'delink_menu_item', 10, 2 );</code> but there were no <code>$items</code> or <code>$args</code>. Does FSE use a new function or filter? I could do this with jQuery, but not my favorite approach.</p>
<p>Thoughts?</p>
| [
{
"answer_id": 413854,
"author": "breadwild",
"author_id": 153797,
"author_profile": "https://wordpress.stackexchange.com/users/153797",
"pm_score": 1,
"selected": false,
"text": "<p>In the end it was too easy to turn to jQuery. I saved it to a .js file, enqueued it, now good to go:</p>\... | 2023/02/14 | [
"https://wordpress.stackexchange.com/questions/413842",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/153797/"
] | I did this all the time pre-full-site-editing, back when we all built menus under Appearance. But without the Menu option under Appearance anymore, how do I do this?
Is it only possible by way of a home-rolled function in functions.php or in javascript?
I tried a function under `add_filter( 'wp_nav_menu_items', 'delink_menu_item', 10, 2 );` but there were no `$items` or `$args`. Does FSE use a new function or filter? I could do this with jQuery, but not my favorite approach.
Thoughts? | The new FSE editor uses a new filter, if you want to hook into that you can do it in two ways:
By hooking the individual block rendering:
```php
add_filter( 'render_block_core/navigation-link', 'test_render_navigation_link', 10, 3);
function test_render_navigation_link($block_content, $block) {
$attributes = $block["attrs"];
// string replace the href if you want, by checking the content of $attributes
return $block_content;
}
```
or by hooking the prerender for the entire navigational menu:
```php
add_filter( 'block_core_navigation_render_inner_blocks', 'replace_nav_blockitem_href');
function replace_nav_blockitem_href( $items ) {
// Loop through the items (they are nested)
foreach ($items as $key => $item) {
//recursive loop through $item->inner_blocks
//once you have found your item then set the attribute url to empty
$item->parsed_block["attrs"]["url"] = null;
}
return $items;
}
```
The rendering of the navigation item will not output the href if the url is empty, this can be seen in the source code of the rendering:
<https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173>
This is the line where the first filter is called:
<https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306>
This is the line where the second filter is called:
<https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512> |
413,851 | <h1>Background</h1>
<p>I have been managing Wordpress sites (and multisite sites) for more than a decade and a half now, and for some reason this is the first time I really had to look into running WordPress in a multilanguage setup.</p>
<p>The project is for a small advisory business where all employees will probably edit some or all of the website at some point, in both the two starter languages.</p>
<p>The most important for me is simplicity of editing, integration into the FSE (as the site has just been rebuilt on top of the twenty twenty-three theme) and Woocommerce support.</p>
<p>Also we want to support having the languages on different domains, ie. sample.de, and sample.us</p>
<p>For each language it is not wanted that the design of the pages change, only the text. However it is expected that there will be lots of small changes all the time, rephrasing something in one language or fixing small mistakes in the other.</p>
<h1>Investigation status</h1>
<p>I have looked into the following existing multi language plugins and have found issues with all of them:</p>
<ul>
<li><p>WPML - the Rome of all search results for Wordpress multilanguage.</p>
<ol>
<li>It is string (or full page) based, which means any small change in the primary language will invalidate all translations (or design changes will only affect one language).</li>
<li>It does not have great interface (i.e. support for the FSE sucks)</li>
</ol>
</li>
<li><p>TranslatePress - the pretty one.</p>
<ol>
<li>It is also string based</li>
</ol>
</li>
<li><p>WPGlobal</p>
<ol>
<li>It does not support FSE</li>
<li>While it is not string (replacement based) it saves the content inside the text and filters it on the output, its a clever trick and could be a fine solution (they could steal some of the ideas from below to support FSE)</li>
<li>If plugin is deactivated all text will be messed up, and show all translations.</li>
</ol>
</li>
</ul>
<h1>Question</h1>
<p>Am I missing something completely obvious (another plugin or setting on the above plugins)</p>
| [
{
"answer_id": 413854,
"author": "breadwild",
"author_id": 153797,
"author_profile": "https://wordpress.stackexchange.com/users/153797",
"pm_score": 1,
"selected": false,
"text": "<p>In the end it was too easy to turn to jQuery. I saved it to a .js file, enqueued it, now good to go:</p>\... | 2023/02/14 | [
"https://wordpress.stackexchange.com/questions/413851",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/65993/"
] | Background
==========
I have been managing Wordpress sites (and multisite sites) for more than a decade and a half now, and for some reason this is the first time I really had to look into running WordPress in a multilanguage setup.
The project is for a small advisory business where all employees will probably edit some or all of the website at some point, in both the two starter languages.
The most important for me is simplicity of editing, integration into the FSE (as the site has just been rebuilt on top of the twenty twenty-three theme) and Woocommerce support.
Also we want to support having the languages on different domains, ie. sample.de, and sample.us
For each language it is not wanted that the design of the pages change, only the text. However it is expected that there will be lots of small changes all the time, rephrasing something in one language or fixing small mistakes in the other.
Investigation status
====================
I have looked into the following existing multi language plugins and have found issues with all of them:
* WPML - the Rome of all search results for Wordpress multilanguage.
1. It is string (or full page) based, which means any small change in the primary language will invalidate all translations (or design changes will only affect one language).
2. It does not have great interface (i.e. support for the FSE sucks)
* TranslatePress - the pretty one.
1. It is also string based
* WPGlobal
1. It does not support FSE
2. While it is not string (replacement based) it saves the content inside the text and filters it on the output, its a clever trick and could be a fine solution (they could steal some of the ideas from below to support FSE)
3. If plugin is deactivated all text will be messed up, and show all translations.
Question
========
Am I missing something completely obvious (another plugin or setting on the above plugins) | The new FSE editor uses a new filter, if you want to hook into that you can do it in two ways:
By hooking the individual block rendering:
```php
add_filter( 'render_block_core/navigation-link', 'test_render_navigation_link', 10, 3);
function test_render_navigation_link($block_content, $block) {
$attributes = $block["attrs"];
// string replace the href if you want, by checking the content of $attributes
return $block_content;
}
```
or by hooking the prerender for the entire navigational menu:
```php
add_filter( 'block_core_navigation_render_inner_blocks', 'replace_nav_blockitem_href');
function replace_nav_blockitem_href( $items ) {
// Loop through the items (they are nested)
foreach ($items as $key => $item) {
//recursive loop through $item->inner_blocks
//once you have found your item then set the attribute url to empty
$item->parsed_block["attrs"]["url"] = null;
}
return $items;
}
```
The rendering of the navigation item will not output the href if the url is empty, this can be seen in the source code of the rendering:
<https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173>
This is the line where the first filter is called:
<https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306>
This is the line where the second filter is called:
<https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512> |
413,857 | <p>I've set up a CPT via a plugin, including custom fields for first and last name, so I'd like to automatically make the post title "First Name + ' ' + Last Name".</p>
<p>This post almost got me there:</p>
<p><a href="https://wordpress.stackexchange.com/questions/88655/how-to-set-custom-post-type-title-without-supports">How To Set Custom Post Type Title Without Supports</a></p>
<p>But my version (adapted code below) creates a title called "Array Array".</p>
<pre><code>add_filter( 'save_post_practitioners', 'hexagon_practitioner_set_title', 10, 3 );
function hexagon_practitioner_set_title ( $post_id, $post, $update ){
//This temporarily removes filter to prevent infinite loops
remove_filter( 'save_post_practitioners', __FUNCTION__ );
//get first and last name meta
$first = get_metadata( 'first_name', $post_id ); //meta for first name
$last = get_metadata( 'last_name', $post_id ); //meta for last name
$title = $first . ' ' . $last;
//update title
wp_update_post( array( 'ID'=>$post_id, 'post_title'=>$title ) );
//redo filter
add_filter( 'save_post_practitioners', __FUNCTION__, 10, 3 );
}
</code></pre>
<p>I've delved into the functions involved but there seem to be many competing solutions that aren't quite what I'm looking for. What am I getting wrong?</p>
<p>Thanks!</p>
| [
{
"answer_id": 413860,
"author": "shanebp",
"author_id": 16575,
"author_profile": "https://wordpress.stackexchange.com/users/16575",
"pm_score": 0,
"selected": false,
"text": "<p>Try setting the 'single' parameter to <code>true</code>. It's the 4th parameter and defaults to <code>false</... | 2023/02/14 | [
"https://wordpress.stackexchange.com/questions/413857",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/38924/"
] | I've set up a CPT via a plugin, including custom fields for first and last name, so I'd like to automatically make the post title "First Name + ' ' + Last Name".
This post almost got me there:
[How To Set Custom Post Type Title Without Supports](https://wordpress.stackexchange.com/questions/88655/how-to-set-custom-post-type-title-without-supports)
But my version (adapted code below) creates a title called "Array Array".
```
add_filter( 'save_post_practitioners', 'hexagon_practitioner_set_title', 10, 3 );
function hexagon_practitioner_set_title ( $post_id, $post, $update ){
//This temporarily removes filter to prevent infinite loops
remove_filter( 'save_post_practitioners', __FUNCTION__ );
//get first and last name meta
$first = get_metadata( 'first_name', $post_id ); //meta for first name
$last = get_metadata( 'last_name', $post_id ); //meta for last name
$title = $first . ' ' . $last;
//update title
wp_update_post( array( 'ID'=>$post_id, 'post_title'=>$title ) );
//redo filter
add_filter( 'save_post_practitioners', __FUNCTION__, 10, 3 );
}
```
I've delved into the functions involved but there seem to be many competing solutions that aren't quite what I'm looking for. What am I getting wrong?
Thanks! | The issue with your code is that the get\_metadata() function returns an array of values, not a single value. So when you concatenate $first and $last variables in this line $title = $first . ' ' . $last;, you are actually concatenating two arrays, which results in the "Array Array" title.
To fix this, you can use the get\_post\_meta() function instead of get\_metadata() to retrieve the first and last name values as follows:
```
$first = get_post_meta( $post_id, 'first_name', true ); //meta for first name
$last = get_post_meta( $post_id, 'last_name', true ); //meta for last name
```
The third parameter true in the get\_post\_meta() function specifies that you want to retrieve a single value instead of an array of values.
Here's the updated code:
```
add_filter( 'save_post_practitioners', 'hexagon_practitioner_set_title',
10, 3 );
function hexagon_practitioner_set_title ( $post_id, $post, $update ){
//This temporarily removes filter to prevent infinite loops
remove_filter( 'save_post_practitioners', __FUNCTION__ );
//get first and last name meta
$first = get_post_meta( $post_id, 'first_name', true ); //meta for first
name
$last = get_post_meta( $post_id, 'last_name', true ); //meta for last
name
$title = $first . ' ' . $last;
//update title
wp_update_post( array( 'ID'=>$post_id, 'post_title'=>$title ) );
//redo filter
add_filter( 'save_post_practitioners', __FUNCTION__, 10, 3 );
}
```
This should set the post title to "First Name Last Name" as you intended. |
413,895 | <p>I am creating a plugin that uses a React App to run inside the admin section of WordPress, and this app uses React Material UI (MUI) as well.</p>
<p>Everything is great, until I started to use "form" components (such as <code>TextField</code>) and this is when <strong>load-styles.php</strong> started to interfere with the outcome of those files.</p>
<p>After further investigation, it appears like <strong>load-styles.php</strong> is taking precedence over the styles generated by the MUI as you can see in the picture below:</p>
<p><a href="https://i.stack.imgur.com/p7QXC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p7QXC.png" alt="enter image description here" /></a></p>
<p>So, I tried different solutions</p>
<p>First, I tried disabling the styles as described <a href="https://stackoverflow.com/questions/72445747/disabling-load-styles-php-file-in-wordpress">here</a> and <a href="https://stackoverflow.com/questions/18881710/wordpress-disabling-default-styles-load-styles-php">here</a> but this causes ALL styles for the admin area to disappear, which is not good. I only do not want the form styles to be disabled</p>
<p>Then I tried to enqueue and reset the styles I wanted to target by giving them the <code>!important</code> keyword, just like this:</p>
<pre><code>input {
padding: 0 !important;
line-height: normal !important;
min-height: 0 !important;
box-shadow: none !important;
border: medium none currentColor !important;
border-radius: 0 !important;
background-color: transparent !important;
color: inherit !important;
}
</code></pre>
<p>But this would cause a problem, because now the default MUI styles are also overridden (because <code>!important</code> works on them as well), causing the look to be all messed up.</p>
<p>Then, I tried many other solutions, all of them revolve around styling components, but just like above, they end up messing up MUI default styling</p>
<p>Moreover, <a href="https://stackoverflow.com/questions/75000081/css-specificity-about-mui">Someone had a similar problem</a> but no answer to him/her yet, and the suggestion in the comments to use <code><CssBaseline /></code> did not solve anything.</p>
<p>So, the way I am thinking is as follows:</p>
<ol>
<li><p>Is there a way to make the MUI inline styles take precedense over <strong>load-styles.php</strong>?</p>
</li>
<li><p>If not, is there a way to disable parts of the <strong>load-styles.php</strong> ?</p>
</li>
<li><p>If not, how do I style the admin area using React MUI?</p>
</li>
</ol>
<p>Thanks you.</p>
| [
{
"answer_id": 413897,
"author": "mWin",
"author_id": 200051,
"author_profile": "https://wordpress.stackexchange.com/users/200051",
"pm_score": 0,
"selected": false,
"text": "<p>I have similar issue when I was working on Rect part of the plugin.</p>\n<p>It finally worked for me, with CSS... | 2023/02/15 | [
"https://wordpress.stackexchange.com/questions/413895",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/34253/"
] | I am creating a plugin that uses a React App to run inside the admin section of WordPress, and this app uses React Material UI (MUI) as well.
Everything is great, until I started to use "form" components (such as `TextField`) and this is when **load-styles.php** started to interfere with the outcome of those files.
After further investigation, it appears like **load-styles.php** is taking precedence over the styles generated by the MUI as you can see in the picture below:
[](https://i.stack.imgur.com/p7QXC.png)
So, I tried different solutions
First, I tried disabling the styles as described [here](https://stackoverflow.com/questions/72445747/disabling-load-styles-php-file-in-wordpress) and [here](https://stackoverflow.com/questions/18881710/wordpress-disabling-default-styles-load-styles-php) but this causes ALL styles for the admin area to disappear, which is not good. I only do not want the form styles to be disabled
Then I tried to enqueue and reset the styles I wanted to target by giving them the `!important` keyword, just like this:
```
input {
padding: 0 !important;
line-height: normal !important;
min-height: 0 !important;
box-shadow: none !important;
border: medium none currentColor !important;
border-radius: 0 !important;
background-color: transparent !important;
color: inherit !important;
}
```
But this would cause a problem, because now the default MUI styles are also overridden (because `!important` works on them as well), causing the look to be all messed up.
Then, I tried many other solutions, all of them revolve around styling components, but just like above, they end up messing up MUI default styling
Moreover, [Someone had a similar problem](https://stackoverflow.com/questions/75000081/css-specificity-about-mui) but no answer to him/her yet, and the suggestion in the comments to use `<CssBaseline />` did not solve anything.
So, the way I am thinking is as follows:
1. Is there a way to make the MUI inline styles take precedense over **load-styles.php**?
2. If not, is there a way to disable parts of the **load-styles.php** ?
3. If not, how do I style the admin area using React MUI?
Thanks you. | The fundamental issue is that MUI is probably not meant to be used in an environment where there are already styles like this. It's supposed to be the base layer. The WordPress admin has its own styles and it's highly unusual to try and use a completely different UI framework inside of it.
These types of conflicts are inevitable when you try to use 3rd-party UI frameworks inside the WordPress admin, which was not designed to support them. The same issues occur when people try to use Bootstrap in the WordPress admin.
>
> Is there a way to make the MUI inline styles take precedense over
> load-styles.php?
>
>
>
The styles in your screenshot are inline styles, so they are already loading after `load-styles.php`. The reason they're not taking precedence is because the load-styles.php rules have a higher [specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity).
To make your styles take precedence you'd need to increase the specificity of the selectors used by MUI. Whether MUI has tools for that is something you would need to ask them or their community.
>
> If not, is there a way to disable parts of the load-styles.php ?
>
>
>
`load-styles.php` is just outputting all the styles that have been enqueued with `wp_enqeueue_style()` in the admin. You can dequeue them with [`wp_dequeue_style()`](https://developer.wordpress.org/reference/functions/wp_dequeue_style/) but you'll need to know the handle used to register the style. Tools like [Query Monitor](https://en-au.wordpress.org/plugins/query-monitor/) can give you a list of what stylesheets are enqueued, and their handles.
The problem is that the styles you want to remove are probably in a stylesheet with many styles that you don't want to remove, and removing them will probably break parts of the WordPress admin that you still need.
>
> If not, how do I style the admin area using React MUI?
>
>
>
This probably isn't a supported use-case for MUI. If it is they should be able to help. If it isn't then your options are limited:
1. Increase the specificity of MUI selectors, if that's even possible.
2. Add your own stylesheet that corrects any broken visuals caused by the conflict. If MUI uses dynamically generated class names, this will be difficult. |
413,913 | <p>I posted this in stackoverflow as well, so hope it's good to post here as well!</p>
<p>I think this is my last problem to solve before everything clicks into place:</p>
<p>I have a homepage with a custom plugin that sends some data to another page, I am building a theme for this website that works with the plugin.</p>
<p>So in the theme functions.php I have added a</p>
<pre><code>function myvar($vars){
$vars[] = 'ep_year';
$vars[] = 'ep_name';
return $vars;
}
add_filter('query_vars','myvar');
</code></pre>
<p>works a charm, I can send those values over to a custom page with a custom template assigned.
This has a permalink as follows:</p>
<pre><code>http://ngofwp.local/episode/
</code></pre>
<p>and when I send the data over it looks like so (permalinks are enabled):</p>
<pre><code>http://ngofwp.local/episode/?ep_year=2011&ep_name=silly_donkey
</code></pre>
<p>I know I have to use an add_rewrite_rule so I've started coding that as follows:</p>
<pre><code>function custom_rewrite_rule()
{
add_rewrite_rule('^episode/([^/]*)/([^/]*)\.html$','?ep_year=$matches[1]&ep_name=$matches[2]','top');
}
add_action('init', 'custom_rewrite_rule');
</code></pre>
<p>But now for the life of me I have no clue about the formulae to get it to work. I have read the regex rules and tested that particular rewrite on a site that helps you do that.</p>
<p>What I'd like it to look like is this:</p>
<pre><code>http://ngofwp.local/episode/2011/silly_donkey.html
</code></pre>
<p>The</p>
<pre><code>http://ngofwp.local/episode/
</code></pre>
<p>is given by wordpress's permalink setting and is a custom page in the templates folder (it displays correctly)</p>
<p>What did I do wrong?</p>
| [
{
"answer_id": 413897,
"author": "mWin",
"author_id": 200051,
"author_profile": "https://wordpress.stackexchange.com/users/200051",
"pm_score": 0,
"selected": false,
"text": "<p>I have similar issue when I was working on Rect part of the plugin.</p>\n<p>It finally worked for me, with CSS... | 2023/02/16 | [
"https://wordpress.stackexchange.com/questions/413913",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/114397/"
] | I posted this in stackoverflow as well, so hope it's good to post here as well!
I think this is my last problem to solve before everything clicks into place:
I have a homepage with a custom plugin that sends some data to another page, I am building a theme for this website that works with the plugin.
So in the theme functions.php I have added a
```
function myvar($vars){
$vars[] = 'ep_year';
$vars[] = 'ep_name';
return $vars;
}
add_filter('query_vars','myvar');
```
works a charm, I can send those values over to a custom page with a custom template assigned.
This has a permalink as follows:
```
http://ngofwp.local/episode/
```
and when I send the data over it looks like so (permalinks are enabled):
```
http://ngofwp.local/episode/?ep_year=2011&ep_name=silly_donkey
```
I know I have to use an add\_rewrite\_rule so I've started coding that as follows:
```
function custom_rewrite_rule()
{
add_rewrite_rule('^episode/([^/]*)/([^/]*)\.html$','?ep_year=$matches[1]&ep_name=$matches[2]','top');
}
add_action('init', 'custom_rewrite_rule');
```
But now for the life of me I have no clue about the formulae to get it to work. I have read the regex rules and tested that particular rewrite on a site that helps you do that.
What I'd like it to look like is this:
```
http://ngofwp.local/episode/2011/silly_donkey.html
```
The
```
http://ngofwp.local/episode/
```
is given by wordpress's permalink setting and is a custom page in the templates folder (it displays correctly)
What did I do wrong? | The fundamental issue is that MUI is probably not meant to be used in an environment where there are already styles like this. It's supposed to be the base layer. The WordPress admin has its own styles and it's highly unusual to try and use a completely different UI framework inside of it.
These types of conflicts are inevitable when you try to use 3rd-party UI frameworks inside the WordPress admin, which was not designed to support them. The same issues occur when people try to use Bootstrap in the WordPress admin.
>
> Is there a way to make the MUI inline styles take precedense over
> load-styles.php?
>
>
>
The styles in your screenshot are inline styles, so they are already loading after `load-styles.php`. The reason they're not taking precedence is because the load-styles.php rules have a higher [specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity).
To make your styles take precedence you'd need to increase the specificity of the selectors used by MUI. Whether MUI has tools for that is something you would need to ask them or their community.
>
> If not, is there a way to disable parts of the load-styles.php ?
>
>
>
`load-styles.php` is just outputting all the styles that have been enqueued with `wp_enqeueue_style()` in the admin. You can dequeue them with [`wp_dequeue_style()`](https://developer.wordpress.org/reference/functions/wp_dequeue_style/) but you'll need to know the handle used to register the style. Tools like [Query Monitor](https://en-au.wordpress.org/plugins/query-monitor/) can give you a list of what stylesheets are enqueued, and their handles.
The problem is that the styles you want to remove are probably in a stylesheet with many styles that you don't want to remove, and removing them will probably break parts of the WordPress admin that you still need.
>
> If not, how do I style the admin area using React MUI?
>
>
>
This probably isn't a supported use-case for MUI. If it is they should be able to help. If it isn't then your options are limited:
1. Increase the specificity of MUI selectors, if that's even possible.
2. Add your own stylesheet that corrects any broken visuals caused by the conflict. If MUI uses dynamically generated class names, this will be difficult. |
413,917 | <p>The following <code>tax_query</code> returns only matched posts (with 'matchedstring' IN taxonomy array):</p>
<pre><code>function only_returns_matched_posts( $query ) {
if( !$query->is_main_query() || is_admin() )
return;
$taxquery = array(
array(
'taxonomy' => 'mygroup',
'field' => 'slug',
'terms' => 'matchedstring',
'compare'=> 'IN'
)
);
$query->set( 'tax_query', $taxquery );
}
add_action( 'pre_get_posts', 'only_returns_matched_posts' );
</code></pre>
<p>I want the matched posts grouped at the top of the query with the other posts following. Is it possible to either:</p>
<ul>
<li>use this format with a <code>orderby</code></li>
<li>do 2 separate queries and merge them</li>
<li>use a custom Group By SQL query</li>
</ul>
<p>EDIT</p>
<p>I managed to merge 2 queries but I lose the menu_order when I apply <code>post__in</code> to keep the <code>$queryA</code> + <code>$queryB</code> order.
Should I get ids differently than with <code>$query->posts</code> to keep original <code>menu_order</code> of the queries?</p>
<pre><code>function group_matched_posts_at_top( $query ) {
// Check if this is the main query and not in the admin area
if( !$query->is_main_query() || is_admin() )
return;
// Get posts with matched taxonomy + posts without taxonomy
$queryAparams = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order_by' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'tax_query'=> array(
'relation' => 'OR',
array(
'taxonomy' => 'pa_group',
'field' => 'slug',
'terms' => 'matchedstring',
'operator' => 'IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'NOT EXISTS'
)
)
);
// Get posts with other taxonomies
$queryBparams = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order_by' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'tax_query'=> array(
'relation' => 'AND',
array(
'taxonomy' => 'pa_group',
'field' => 'slug',
'terms' => 'matchedstring',
'operator' => 'NOT IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'EXISTS'
)
)
);
$queryA = new WP_Query($queryAparams);
$queryB = new WP_Query($queryBparams);
// Merging ids
$postIDs = array_merge($queryA->posts,$queryB->posts);
if(!empty($postIDs)){
$query->set('post__in', $postIDs);
$query->set('orderby', 'post__in');
}
}
add_action( 'woocommerce_product_query', 'group_matched_posts_at_top' );
</code></pre>
<p>EDIT2</p>
<p>I'll post my own answer.
I had to actually remove the <code>'fields' => 'ids'</code> parameters to keep the queries <code>menu_order</code> and pluck the ids after resorting them.</p>
| [
{
"answer_id": 413932,
"author": "Lewis",
"author_id": 105112,
"author_profile": "https://wordpress.stackexchange.com/users/105112",
"pm_score": 1,
"selected": false,
"text": "<p>You could try modifying the tax query to use the <code>relation</code> parameter and add a second clause that... | 2023/02/16 | [
"https://wordpress.stackexchange.com/questions/413917",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/220436/"
] | The following `tax_query` returns only matched posts (with 'matchedstring' IN taxonomy array):
```
function only_returns_matched_posts( $query ) {
if( !$query->is_main_query() || is_admin() )
return;
$taxquery = array(
array(
'taxonomy' => 'mygroup',
'field' => 'slug',
'terms' => 'matchedstring',
'compare'=> 'IN'
)
);
$query->set( 'tax_query', $taxquery );
}
add_action( 'pre_get_posts', 'only_returns_matched_posts' );
```
I want the matched posts grouped at the top of the query with the other posts following. Is it possible to either:
* use this format with a `orderby`
* do 2 separate queries and merge them
* use a custom Group By SQL query
EDIT
I managed to merge 2 queries but I lose the menu\_order when I apply `post__in` to keep the `$queryA` + `$queryB` order.
Should I get ids differently than with `$query->posts` to keep original `menu_order` of the queries?
```
function group_matched_posts_at_top( $query ) {
// Check if this is the main query and not in the admin area
if( !$query->is_main_query() || is_admin() )
return;
// Get posts with matched taxonomy + posts without taxonomy
$queryAparams = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order_by' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'tax_query'=> array(
'relation' => 'OR',
array(
'taxonomy' => 'pa_group',
'field' => 'slug',
'terms' => 'matchedstring',
'operator' => 'IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'NOT EXISTS'
)
)
);
// Get posts with other taxonomies
$queryBparams = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order_by' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'tax_query'=> array(
'relation' => 'AND',
array(
'taxonomy' => 'pa_group',
'field' => 'slug',
'terms' => 'matchedstring',
'operator' => 'NOT IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'EXISTS'
)
)
);
$queryA = new WP_Query($queryAparams);
$queryB = new WP_Query($queryBparams);
// Merging ids
$postIDs = array_merge($queryA->posts,$queryB->posts);
if(!empty($postIDs)){
$query->set('post__in', $postIDs);
$query->set('orderby', 'post__in');
}
}
add_action( 'woocommerce_product_query', 'group_matched_posts_at_top' );
```
EDIT2
I'll post my own answer.
I had to actually remove the `'fields' => 'ids'` parameters to keep the queries `menu_order` and pluck the ids after resorting them. | I finally managed to do it by merging 2 queries.
I'm using it with a woocommerce attribute but it can work with any taxonomy.
```
function group_matched_posts_at_top( $query ) {
// Modify the query only if it's the main query and it's a product archive page
if ( !$query->is_main_query() || !(is_product_category() || is_shop()) || is_admin() ) {
return;
}
// String to match
$string_to_match = 'Whatever taxonomy';
// Query for products with matched taxonomy
$query1 = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => -1,
'post_status' => 'publish',
'order_by' => 'menu_order',
'order' => 'ASC',
'tax_query'=> array(
'relation' => 'OR',
array(
'taxonomy' => 'pa_group',
'field' => 'name',
'terms' => $string_to_match,
'operator' => 'IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'NOT EXISTS'
)
)
) );
// Sorting first query before merging
usort( $query1->posts, function( $a, $b ) {
return $a->menu_order - $b->menu_order;
} );
// Query for other products
$query2 = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => -1,
'post_status' => 'publish',
'order_by' => 'menu_order',
'order' => 'ASC',
'tax_query'=> array(
'relation' => 'AND',
array(
'taxonomy' => 'pa_group',
'field' => 'name',
'terms' => $string_to_match,
'operator' => 'NOT IN'
),
array(
'taxonomy' => 'pa_group',
'operator' => 'EXISTS'
)
)
) );
// Sorting second query before merging
usort( $query2->posts, function( $a, $b ) {
return $a->menu_order - $b->menu_order;
} );
// Merge the results in the desired order
$products = array_merge( $query1->posts, $query2->posts );
// Set the modified query results
$query->set( 'posts_per_page', -1 );
$query->set( 'post__in', wp_list_pluck( $products, 'ID' ) );
// keep the order
$query->set( 'orderby', 'post__in' );
}
add_action( 'pre_get_posts', 'group_matched_posts_at_top' );
``` |
413,949 | <p>I have a custom post type which checks and validates some (custom) meta fields added with it upon publishing. I am using <code>wp_insert_post_data</code> for the purpose:</p>
<pre><code>public function __construct()
{
$this->sconfig= ['post_type'=> 'event', 'slug'=>'events'];
add_filter('wp_insert_post_data', array($this, 'validate_event_meta'), 99, 2);
add_filter('post_updated_messages', array($this, 'event_save_update_msg'), 10, 1);
//add_action('admin_notices', array($this, 'event_save_update_msg'));
}
function validate_event_meta($postData, $postArray)
{
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return $postData;
}
if (array_key_exists('post_type', $postData) && $postData['post_type'] === $this->sconfig['post_type']) {
if (array_key_exists('post_status', $postData) && $postData['post_status'] === 'publish') {
$valstat = $this->get_meta_posted_vals();
/*
$valstat['stat'] is 0 or 1 depending on validation success
$valstat['log'] has the error message
*/
if ($valstat['stat'] == 0) {
$postData['post_status'] = 'draft';
set_transient(get_current_user_id() . '_event8273_add_notice', 'ERROR: ' . $valstat['log']);
add_filter('redirect_post_location', array($this, 'alter_event_save_redirect'), 99);
}
}
}
return $postData;
}
function alter_event_save_redirect($location)
{
remove_filter('redirect_post_location', __FUNCTION__, 99);
$location = remove_query_arg('message', $location);
$location = add_query_arg('message', 99, $location);
return $location;
}
function event_save_update_msg($messages)
{
$message = get_transient(get_current_user_id() . '_event8273_add_notice');
if ($message) {
delete_transient(get_current_user_id() . '_event8273_add_notice');
//echo $message;
//$messages['post'][99] = $message;
$messages[$this->sconfig['post_type']][99] = $message;
}
return $messages;
}
</code></pre>
<p>Though the validation system is working correctly, I cannot display any notices on the error. Each time the code encounters invalid meta value during 'publish', it reverts the post into 'draft' status and the 'Draft Saved <em>Preview</em>' message pops up.</p>
<p>Upon some research, I have found that the <a href="https://developer.wordpress.org/block-editor/how-to-guides/notices/#notices-in-the-block-editor" rel="nofollow noreferrer">block editor uses javascript to display custom notices</a>. But what I cannot understand is how to call the javascript function (file already enqueued in admin) after the validation from <code>wp_insert_post_data</code>.</p>
<pre><code>function event_save_alert(errmsg)
{
( function ( wp ) {
wp.data.dispatch( 'core/notices' ).createNotice(
'error', // Can be one of: success, info, warning, error.
errmsg, // Text string to display.
{
isDismissible: true, // Whether the user can dismiss the notice.
// Any actions the user can perform.
actions: [
{
url: '#',
label: 'View post',
},
],
}
);
} )( window.wp );
}
</code></pre>
<p>Any kind of help is appreciated. Thanks for reading this far and giving it a thought.</p>
| [
{
"answer_id": 413955,
"author": "Christopher Jaya Wiguna",
"author_id": 227174,
"author_profile": "https://wordpress.stackexchange.com/users/227174",
"pm_score": 0,
"selected": false,
"text": "<p>Since the notice is not a regular one, making a custom javascript notice would be easier. F... | 2023/02/17 | [
"https://wordpress.stackexchange.com/questions/413949",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/92425/"
] | I have a custom post type which checks and validates some (custom) meta fields added with it upon publishing. I am using `wp_insert_post_data` for the purpose:
```
public function __construct()
{
$this->sconfig= ['post_type'=> 'event', 'slug'=>'events'];
add_filter('wp_insert_post_data', array($this, 'validate_event_meta'), 99, 2);
add_filter('post_updated_messages', array($this, 'event_save_update_msg'), 10, 1);
//add_action('admin_notices', array($this, 'event_save_update_msg'));
}
function validate_event_meta($postData, $postArray)
{
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return $postData;
}
if (array_key_exists('post_type', $postData) && $postData['post_type'] === $this->sconfig['post_type']) {
if (array_key_exists('post_status', $postData) && $postData['post_status'] === 'publish') {
$valstat = $this->get_meta_posted_vals();
/*
$valstat['stat'] is 0 or 1 depending on validation success
$valstat['log'] has the error message
*/
if ($valstat['stat'] == 0) {
$postData['post_status'] = 'draft';
set_transient(get_current_user_id() . '_event8273_add_notice', 'ERROR: ' . $valstat['log']);
add_filter('redirect_post_location', array($this, 'alter_event_save_redirect'), 99);
}
}
}
return $postData;
}
function alter_event_save_redirect($location)
{
remove_filter('redirect_post_location', __FUNCTION__, 99);
$location = remove_query_arg('message', $location);
$location = add_query_arg('message', 99, $location);
return $location;
}
function event_save_update_msg($messages)
{
$message = get_transient(get_current_user_id() . '_event8273_add_notice');
if ($message) {
delete_transient(get_current_user_id() . '_event8273_add_notice');
//echo $message;
//$messages['post'][99] = $message;
$messages[$this->sconfig['post_type']][99] = $message;
}
return $messages;
}
```
Though the validation system is working correctly, I cannot display any notices on the error. Each time the code encounters invalid meta value during 'publish', it reverts the post into 'draft' status and the 'Draft Saved *Preview*' message pops up.
Upon some research, I have found that the [block editor uses javascript to display custom notices](https://developer.wordpress.org/block-editor/how-to-guides/notices/#notices-in-the-block-editor). But what I cannot understand is how to call the javascript function (file already enqueued in admin) after the validation from `wp_insert_post_data`.
```
function event_save_alert(errmsg)
{
( function ( wp ) {
wp.data.dispatch( 'core/notices' ).createNotice(
'error', // Can be one of: success, info, warning, error.
errmsg, // Text string to display.
{
isDismissible: true, // Whether the user can dismiss the notice.
// Any actions the user can perform.
actions: [
{
url: '#',
label: 'View post',
},
],
}
);
} )( window.wp );
}
```
Any kind of help is appreciated. Thanks for reading this far and giving it a thought. | >
> what I cannot understand is how to call the javascript function (file
> already enqueued in admin) after the validation from
> `wp_insert_post_data`
>
>
>
You can use the same approach that Gutenberg uses for saving meta boxes (or custom fields), which you can [find here on GitHub](https://github.com/WordPress/gutenberg/blob/0b5ca2239f012e676d70d5011f9f96c503cc8220/packages/edit-post/src/store/actions.js#L557-L583). It basically uses [`wp.data.subscribe()`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#subscribe) to listen to changes in the editor's state (e.g. whether the editor is saving or autosaving the current post) and after the post is saved (but **not** autosaved), the meta boxes will be saved.
As for the PHP part, you can just store the error in a cookie and read its value using the [`window.wpCookies` API](https://github.com/WordPress/wordpress-develop/blob/6.1.1/src/js/_enqueues/lib/cookies.js#L10), which is a custom JavaScript cookie API written by WordPress.
So for example, I used the following when testing:
* PHP: `setcookie( 'event8273_add_notice', 'ERROR: A test error ' . time(), 0, '/' );`
* JS: `wpCookies.get( 'event8273_add_notice' )`
And for checking for and displaying the error, I used this:
```js
( () => {
const editor = wp.data.select( 'core/editor' );
// Name of the cookie which contains the error message.
const cookieName = 'event8273_add_notice';
// Set the initial state.
let wasSavingPost = editor.isSavingPost();
let wasAutosavingPost = editor.isAutosavingPost();
wp.data.subscribe( () => {
const isSavingPost = editor.isSavingPost();
const isAutosavingPost = editor.isAutosavingPost();
// Display the error on save completion, except for autosaves.
const shouldDisplayNotice =
wasSavingPost &&
! wasAutosavingPost &&
! isSavingPost &&
// If its status is draft, then maybe there was an error.
( 'draft' === editor.getEditedPostAttribute( 'status' ) );
// Save current state for next inspection.
wasSavingPost = isSavingPost;
wasAutosavingPost = isAutosavingPost;
if ( shouldDisplayNotice ) {
const error = wpCookies.get( cookieName );
// If there was an error, display it as a notice, and then remove
// the cookie.
if ( error ) {
event_save_alert( error );
wpCookies.remove( cookieName, '/' );
}
}
} );
} )();
```
So just copy that and paste it into your JS file, after your custom `event_save_alert()` function.
* Make sure that the script's dependencies contain `wp-data`, `utils` *and* `wp-edit-post`.
* You should also load the script only on the post editing screen for your post type. E.g.
```php
add_action( 'enqueue_block_editor_assets', function () {
if ( is_admin() && 'event' === get_current_screen()->id ) {
wp_enqueue_script(
'your-handle',
plugins_url( 'path/to/file.js', __FILE__ ),
array( 'wp-data', 'utils', 'wp-edit-post' )
);
}
} );
``` |
414,034 | <p>I have created a number of RESTful endpoints via a plugin. To date I have only accessed them from the host site. However I would like to access these endpoints from a sub-domaine(2ed Wordpress installation). An application password appears to be a good way to set up authentication for accessing these endpoints in my application. However I can not find any documentation as to how to modify my 'permission_callback' to recognize application passwords.</p>
| [
{
"answer_id": 413955,
"author": "Christopher Jaya Wiguna",
"author_id": 227174,
"author_profile": "https://wordpress.stackexchange.com/users/227174",
"pm_score": 0,
"selected": false,
"text": "<p>Since the notice is not a regular one, making a custom javascript notice would be easier. F... | 2023/02/20 | [
"https://wordpress.stackexchange.com/questions/414034",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/141022/"
] | I have created a number of RESTful endpoints via a plugin. To date I have only accessed them from the host site. However I would like to access these endpoints from a sub-domaine(2ed Wordpress installation). An application password appears to be a good way to set up authentication for accessing these endpoints in my application. However I can not find any documentation as to how to modify my 'permission\_callback' to recognize application passwords. | >
> what I cannot understand is how to call the javascript function (file
> already enqueued in admin) after the validation from
> `wp_insert_post_data`
>
>
>
You can use the same approach that Gutenberg uses for saving meta boxes (or custom fields), which you can [find here on GitHub](https://github.com/WordPress/gutenberg/blob/0b5ca2239f012e676d70d5011f9f96c503cc8220/packages/edit-post/src/store/actions.js#L557-L583). It basically uses [`wp.data.subscribe()`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#subscribe) to listen to changes in the editor's state (e.g. whether the editor is saving or autosaving the current post) and after the post is saved (but **not** autosaved), the meta boxes will be saved.
As for the PHP part, you can just store the error in a cookie and read its value using the [`window.wpCookies` API](https://github.com/WordPress/wordpress-develop/blob/6.1.1/src/js/_enqueues/lib/cookies.js#L10), which is a custom JavaScript cookie API written by WordPress.
So for example, I used the following when testing:
* PHP: `setcookie( 'event8273_add_notice', 'ERROR: A test error ' . time(), 0, '/' );`
* JS: `wpCookies.get( 'event8273_add_notice' )`
And for checking for and displaying the error, I used this:
```js
( () => {
const editor = wp.data.select( 'core/editor' );
// Name of the cookie which contains the error message.
const cookieName = 'event8273_add_notice';
// Set the initial state.
let wasSavingPost = editor.isSavingPost();
let wasAutosavingPost = editor.isAutosavingPost();
wp.data.subscribe( () => {
const isSavingPost = editor.isSavingPost();
const isAutosavingPost = editor.isAutosavingPost();
// Display the error on save completion, except for autosaves.
const shouldDisplayNotice =
wasSavingPost &&
! wasAutosavingPost &&
! isSavingPost &&
// If its status is draft, then maybe there was an error.
( 'draft' === editor.getEditedPostAttribute( 'status' ) );
// Save current state for next inspection.
wasSavingPost = isSavingPost;
wasAutosavingPost = isAutosavingPost;
if ( shouldDisplayNotice ) {
const error = wpCookies.get( cookieName );
// If there was an error, display it as a notice, and then remove
// the cookie.
if ( error ) {
event_save_alert( error );
wpCookies.remove( cookieName, '/' );
}
}
} );
} )();
```
So just copy that and paste it into your JS file, after your custom `event_save_alert()` function.
* Make sure that the script's dependencies contain `wp-data`, `utils` *and* `wp-edit-post`.
* You should also load the script only on the post editing screen for your post type. E.g.
```php
add_action( 'enqueue_block_editor_assets', function () {
if ( is_admin() && 'event' === get_current_screen()->id ) {
wp_enqueue_script(
'your-handle',
plugins_url( 'path/to/file.js', __FILE__ ),
array( 'wp-data', 'utils', 'wp-edit-post' )
);
}
} );
``` |
414,039 | <p>I have always used the <em>get_avatar_url</em> filter to alter the user avatar where it's printed.</p>
<pre><code>add_filter( 'get_avatar_url', 'my\plugin\filter_get_avatar_url', 10, 3 );
function filter_get_avatar_url( $url, $id_or_email, $args ) {
// Do something and return whatever I want
}
</code></pre>
<p>But now I am printing comments with the wp_list_comments() function. And it's getting the avatar from Gravatar.</p>
<p>I expect it to respect the filter. What should I do?</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/20 | [
"https://wordpress.stackexchange.com/questions/414039",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/155394/"
] | I have always used the *get\_avatar\_url* filter to alter the user avatar where it's printed.
```
add_filter( 'get_avatar_url', 'my\plugin\filter_get_avatar_url', 10, 3 );
function filter_get_avatar_url( $url, $id_or_email, $args ) {
// Do something and return whatever I want
}
```
But now I am printing comments with the wp\_list\_comments() function. And it's getting the avatar from Gravatar.
I expect it to respect the filter. What should I do? | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,048 | <p>I have two versions of the simplest function that hooked to the <code>wp_head</code> action.</p>
<p>One is working, andother one is not.</p>
<p>Can someone explain?</p>
<pre><code>// Works !
function custom_description() {
?>
<meta name="description" content="cococo" />
<?php
}
// Does not work
/*
function custom_description() {
return '<meta name="description" content="cococo" />';
}
*/
add_action( 'wp_head', 'custom_description' );
</code></pre>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/20 | [
"https://wordpress.stackexchange.com/questions/414048",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/208758/"
] | I have two versions of the simplest function that hooked to the `wp_head` action.
One is working, andother one is not.
Can someone explain?
```
// Works !
function custom_description() {
?>
<meta name="description" content="cococo" />
<?php
}
// Does not work
/*
function custom_description() {
return '<meta name="description" content="cococo" />';
}
*/
add_action( 'wp_head', 'custom_description' );
``` | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,110 | <p><strong>Added</strong> Note that this process is in a WP plugin, using thw WP API, so I believe this is appropriate for this SO and should not be closed.</p>
<p>The following REST call is used to get a specific comment:</p>
<pre><code>var comment_id = 239;
response = wp.apiRequest( { // ajax post to set up comment redact meta value
path: 'wp/v2/comments/' + comment_id ,
method: 'POST',
data: thedata
} );
</code></pre>
<p>This returns a JSON object, and the next step is to get the comment text from the JSON object, which contains these values (not complete response, and sanitized):</p>
<pre><code>{
"id": 239,
"post": 424,
"parent": 0,
"author": 1,
"author_name": "username",
"author_url": "",
"date": "2023-02-20T12:43:02",
"date_gmt": "2023-02-20T20:43:02",
"content": {
"rendered": "<div class=\"comment_text\"><p>here is a comment</p>\n</div>"
},
"link": "https://example.com/my-test-post/#comment-239",
"status": "approved",
"type": "comment",
}
</code></pre>
<p>My problem is I can't figure out how to get the 'rendered' value. I have tried this:</p>
<pre><code>response_array = JSON.parse(response.responseText);
</code></pre>
<p>but get an error:</p>
<pre><code>JSON.parse: unexpected character at line 1 column 1 of the JSON data
</code></pre>
<p>Still learning JSON, and have done many searches to now avail.</p>
<p>What JS code will get me the comment text out of the response object?</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/23 | [
"https://wordpress.stackexchange.com/questions/414110",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/29416/"
] | **Added** Note that this process is in a WP plugin, using thw WP API, so I believe this is appropriate for this SO and should not be closed.
The following REST call is used to get a specific comment:
```
var comment_id = 239;
response = wp.apiRequest( { // ajax post to set up comment redact meta value
path: 'wp/v2/comments/' + comment_id ,
method: 'POST',
data: thedata
} );
```
This returns a JSON object, and the next step is to get the comment text from the JSON object, which contains these values (not complete response, and sanitized):
```
{
"id": 239,
"post": 424,
"parent": 0,
"author": 1,
"author_name": "username",
"author_url": "",
"date": "2023-02-20T12:43:02",
"date_gmt": "2023-02-20T20:43:02",
"content": {
"rendered": "<div class=\"comment_text\"><p>here is a comment</p>\n</div>"
},
"link": "https://example.com/my-test-post/#comment-239",
"status": "approved",
"type": "comment",
}
```
My problem is I can't figure out how to get the 'rendered' value. I have tried this:
```
response_array = JSON.parse(response.responseText);
```
but get an error:
```
JSON.parse: unexpected character at line 1 column 1 of the JSON data
```
Still learning JSON, and have done many searches to now avail.
What JS code will get me the comment text out of the response object? | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,200 | <p>I am creating a job board website(it is a part of the website). I have a <code>JobOffer</code> class with some rows in the database(added with it's form...). My problem now is to have a page for each of these JobOffers. I can't use it as a <code>WP_Post</code> because a want a custom rendering, i will need to add own data.
This is my idea:</p>
<ul>
<li>Create a page(from the wordpress dashboard -> Pages) with the name "Job Offer" and slug "job-offer"</li>
<li>Set the link a <code>JobOffer</code> like <code>/job-offer?id={job_id}&label={job_label}</code></li>
<li>In the "Job Offer" page only add this shotcode: <code>[single-job-offer]</code></li>
<li>In the shortcode definition get the id (<code>$_GET['id']</code>) and the label(<code>$_GET['label']</code>) and render the content as i want</li>
<li>Change the page url and page title in the browser with javascript:</li>
</ul>
<pre class="lang-js prettyprint-override"><code>document.title = "The job title"
window.history.pushState("url_with_a_better_form");
</code></pre>
<p>But it is not a good <a href="https://stackoverflow.com/a/413455/13808068">idea</a>.</p>
<p>Hoping i explain well what i want, what do you think i should do to follow SEO rules and have a page for all JobOffers, each of these pages having a title, a custom url and my shortcode as content.</p>
<p><strong>EDIT</strong>:
I followed the links given and i created my custom post type:</p>
<pre class="lang-php prettyprint-override"><code>function phenix_custom_post_type()
{
register_post_type(
'phenix_job_offer',
array(
'labels' => array(
'name' => 'Job Offers',
'singular_name' => 'Job Offer',
),
'public' => true,
'show_ui' => false,
'rewrite' => array(
'slug' => 'offres'
)
)
);
}
add_action('init', 'phenix_custom_post_type');
</code></pre>
<p>And my template(single-phenix_blue_color.php):</p>
<pre class="lang-php prettyprint-override"><code><?php
get_header();
do_action('onepress_page_before_content'); // I'm working in my child theme and the parent is OnePress
?>
<div id="content" class="site-content">
<?php onepress_breadcrumb(); ?>
<div id="content-inside" class="container ">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/content', 'single'); ?>
<hr class="hr">
<?php
if (is_user_logged_in() && in_array('subscriber', _wp_get_current_user()->roles)) :
//
if ($job_apps != null && count($job_apps) > 0) {
$tmp = array_filter($job_apps, function (JobApplication $elt) {
return is_int(strpos($_SERVER['REQUEST_URI'], $elt->job->post_name));
});
if (count($tmp) > 0)
echo "<div class='mt-2 mb-3 h6'><span class='alert alert-info'>" . do_shortcode('[icon name="circle-info" prefix="fas"]') . " ...</span></div>";
}
?>
<p class="h5 mb-3">...</p>
<?= do_shortcode('[form-job-application]') ?>
<?php else : ?>
<p class="h6">
////
<?php if (!is_user_logged_in()) : ?>
///////
<?php endif; ?>
</p>
<?php endif; ?>
<?php endwhile; ?>
</main>
</div>
</div>
</div>
<?php get_footer(); ?>
</code></pre>
<p>Sorry for the length.
I manually created a post in the database with the <code>phenix_job_offer</code> type and it displays well. I am still thinking on how i can more customize the template but my problem is: How can i tell the template to not try to fetch the post in the database but use my post(a custom wp_post that i will create just for the rendering of my <code>JobOffer</code>) ?</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/26 | [
"https://wordpress.stackexchange.com/questions/414200",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/229316/"
] | I am creating a job board website(it is a part of the website). I have a `JobOffer` class with some rows in the database(added with it's form...). My problem now is to have a page for each of these JobOffers. I can't use it as a `WP_Post` because a want a custom rendering, i will need to add own data.
This is my idea:
* Create a page(from the wordpress dashboard -> Pages) with the name "Job Offer" and slug "job-offer"
* Set the link a `JobOffer` like `/job-offer?id={job_id}&label={job_label}`
* In the "Job Offer" page only add this shotcode: `[single-job-offer]`
* In the shortcode definition get the id (`$_GET['id']`) and the label(`$_GET['label']`) and render the content as i want
* Change the page url and page title in the browser with javascript:
```js
document.title = "The job title"
window.history.pushState("url_with_a_better_form");
```
But it is not a good [idea](https://stackoverflow.com/a/413455/13808068).
Hoping i explain well what i want, what do you think i should do to follow SEO rules and have a page for all JobOffers, each of these pages having a title, a custom url and my shortcode as content.
**EDIT**:
I followed the links given and i created my custom post type:
```php
function phenix_custom_post_type()
{
register_post_type(
'phenix_job_offer',
array(
'labels' => array(
'name' => 'Job Offers',
'singular_name' => 'Job Offer',
),
'public' => true,
'show_ui' => false,
'rewrite' => array(
'slug' => 'offres'
)
)
);
}
add_action('init', 'phenix_custom_post_type');
```
And my template(single-phenix\_blue\_color.php):
```php
<?php
get_header();
do_action('onepress_page_before_content'); // I'm working in my child theme and the parent is OnePress
?>
<div id="content" class="site-content">
<?php onepress_breadcrumb(); ?>
<div id="content-inside" class="container ">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/content', 'single'); ?>
<hr class="hr">
<?php
if (is_user_logged_in() && in_array('subscriber', _wp_get_current_user()->roles)) :
//
if ($job_apps != null && count($job_apps) > 0) {
$tmp = array_filter($job_apps, function (JobApplication $elt) {
return is_int(strpos($_SERVER['REQUEST_URI'], $elt->job->post_name));
});
if (count($tmp) > 0)
echo "<div class='mt-2 mb-3 h6'><span class='alert alert-info'>" . do_shortcode('[icon name="circle-info" prefix="fas"]') . " ...</span></div>";
}
?>
<p class="h5 mb-3">...</p>
<?= do_shortcode('[form-job-application]') ?>
<?php else : ?>
<p class="h6">
////
<?php if (!is_user_logged_in()) : ?>
///////
<?php endif; ?>
</p>
<?php endif; ?>
<?php endwhile; ?>
</main>
</div>
</div>
</div>
<?php get_footer(); ?>
```
Sorry for the length.
I manually created a post in the database with the `phenix_job_offer` type and it displays well. I am still thinking on how i can more customize the template but my problem is: How can i tell the template to not try to fetch the post in the database but use my post(a custom wp\_post that i will create just for the rendering of my `JobOffer`) ? | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,228 | <p>I have a WP_Query which has the "posts_per_page" parameter set to 12. I am then using a while loop to iterate over all of the posts and an IF statement to check whether a condition is true or false. I would like to be able to display 12 posts which return true however, the loop is obviously also counting each post returning false and displaying nothing. For example, 5 posts would be displayed but the other 7 are not displayed.</p>
<pre><code>$args = array(
'post_type' => $post_slug,
'posts_per_page' => 12,
'paged' => 1,
'post_status' => 'publish',
);
$topicsHub = new WP_Query($args);
<?php while ( $topicsHub->have_posts() ) : $topicsHub->the_post();
$resource_type = get_post_type();
if($resource_type == 'tools') {
$stream = get_field('stream_name', get_the_ID());
$tooltype = get_field('tools_type', get_the_ID());
$stream_name = $stream;
foreach ($options['streams'] as $key => $subscription) {
if(in_array($subscription['parent_stream_name'], $stream)){
$stream_name = [];
$stream_name[] = $subscription['name'];
break;
}
}
// Custom function
if(check_if_user_has_access($stream_name, 'something')) {
if($tooltype == 'free') {
continue;
}
} else {
if($tooltype == 'premium') {
continue;
}
}
}
?>
<div class="u-12 u-6@sm u-4@md resource__main-tab--item">
<?php get_template_part('partial/content', 'topics-card'); ?>
</div>
<?php endwhile; ?>
</code></pre>
<p>I understand why this is happening but am not sure how I could only show 12 posts that only return true.</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/27 | [
"https://wordpress.stackexchange.com/questions/414228",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/230362/"
] | I have a WP\_Query which has the "posts\_per\_page" parameter set to 12. I am then using a while loop to iterate over all of the posts and an IF statement to check whether a condition is true or false. I would like to be able to display 12 posts which return true however, the loop is obviously also counting each post returning false and displaying nothing. For example, 5 posts would be displayed but the other 7 are not displayed.
```
$args = array(
'post_type' => $post_slug,
'posts_per_page' => 12,
'paged' => 1,
'post_status' => 'publish',
);
$topicsHub = new WP_Query($args);
<?php while ( $topicsHub->have_posts() ) : $topicsHub->the_post();
$resource_type = get_post_type();
if($resource_type == 'tools') {
$stream = get_field('stream_name', get_the_ID());
$tooltype = get_field('tools_type', get_the_ID());
$stream_name = $stream;
foreach ($options['streams'] as $key => $subscription) {
if(in_array($subscription['parent_stream_name'], $stream)){
$stream_name = [];
$stream_name[] = $subscription['name'];
break;
}
}
// Custom function
if(check_if_user_has_access($stream_name, 'something')) {
if($tooltype == 'free') {
continue;
}
} else {
if($tooltype == 'premium') {
continue;
}
}
}
?>
<div class="u-12 u-6@sm u-4@md resource__main-tab--item">
<?php get_template_part('partial/content', 'topics-card'); ?>
</div>
<?php endwhile; ?>
```
I understand why this is happening but am not sure how I could only show 12 posts that only return true. | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,274 | <p>I have created an example.php:</p>
<pre><code><?php get_header();
get_template_part('template-parts/banner','title'); ?>
<div class="container">
<p>HERE GOES THE TEXT</p>
</div>
<?php get_footer(); ?>
</code></pre>
<p>in the page-main.php I have created a link:
<code><a href="<?php echo site_url('/example.php'); ?></a></code></p>
<p>When I click it I can see in (page.php/example-php) the header, the footer but NOT the html part. What am I doing wrong?</p>
<p>Please help and thank You for Your help.</p>
<p>After searching the net and reading, I figured that inserting this code:</p>
<pre><code> <?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile;
?>
</code></pre>
<p>made my day. Now I can display my page as a new separate page.
So now all the code looks like this:</p>
<pre><code><?php get_header();
get_template_part('template-parts/banner','title'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile;
?>
<div class="container">
<p>HERE GOES THE TEXT</p>
</div>
<?php get_footer(); ?>
</code></pre>
<p>But if You think that its wrong what I have done please let me know. I am learning so please forgive me for my lack of knowledge.</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/02/28 | [
"https://wordpress.stackexchange.com/questions/414274",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/90451/"
] | I have created an example.php:
```
<?php get_header();
get_template_part('template-parts/banner','title'); ?>
<div class="container">
<p>HERE GOES THE TEXT</p>
</div>
<?php get_footer(); ?>
```
in the page-main.php I have created a link:
`<a href="<?php echo site_url('/example.php'); ?></a>`
When I click it I can see in (page.php/example-php) the header, the footer but NOT the html part. What am I doing wrong?
Please help and thank You for Your help.
After searching the net and reading, I figured that inserting this code:
```
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile;
?>
```
made my day. Now I can display my page as a new separate page.
So now all the code looks like this:
```
<?php get_header();
get_template_part('template-parts/banner','title'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile;
?>
<div class="container">
<p>HERE GOES THE TEXT</p>
</div>
<?php get_footer(); ?>
```
But if You think that its wrong what I have done please let me know. I am learning so please forgive me for my lack of knowledge. | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,293 | <p>Where should I develop my new version of my WordPress site while my current version is live? In a subdomain of the live one? I want to work on the new site where team members can view the newest updates and where it will be easy to replace the old site with the new one once it is done.
Thanks!</p>
| [
{
"answer_id": 414040,
"author": "Mahmudul Hasan",
"author_id": 207942,
"author_profile": "https://wordpress.stackexchange.com/users/207942",
"pm_score": 1,
"selected": false,
"text": "<p>By default, <code>wp_list_comments()</code> uses the <code>get_avatar()</code> function to display u... | 2023/03/01 | [
"https://wordpress.stackexchange.com/questions/414293",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/230423/"
] | Where should I develop my new version of my WordPress site while my current version is live? In a subdomain of the live one? I want to work on the new site where team members can view the newest updates and where it will be easy to replace the old site with the new one once it is done.
Thanks! | By default, `wp_list_comments()` uses the `get_avatar()` function to display user avatars, which in turn retrieves the avatar URL from Gravatar. However, `get_avatar()` also applies the `get_avatar_url` filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.
Here's an example of how you can modify the avatar URL for comments using the `get_avatar_url` filter:
```
add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );
function my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {
// Check if we are displaying a comment avatar
if ( is_object( $args ) && isset( $args->object_type ) && $args->object_type === 'comment' ) {
// Do something to modify the avatar URL for comments
$modified_url = 'https://example.com/my-modified-avatar-url.jpg';
return $modified_url;
}
// Return the original avatar URL for other cases
return $url;
}
```
In this example, we check if the `object_type` argument of the `$args` parameter is set to 'comment', which indicates that we are displaying a comment avatar. If that's the case, we modify the avatar URL as desired, and return the modified URL. For other cases, we simply return the original URL.
Note that if you have other filters hooked to the `get_avatar_url` filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running. |
414,324 | <p>Here is my array which I am trying to get "apple" keyword in post table but it can't work like I want. Please let me know what is wrong with my array?</p>
<pre><code>Array
(
[paged] => 1
[posts_per_page] => 50
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => product_type
[field] => slug
[terms] => Array
(
[0] => chipin
)
[operator] => NOT IN
)
)
[status] => publish
[orderby] => date
[order] => DESC
[meta_query] => Array
(
[0] => Array
(
[key] => _stock_status
[value] => instock
)
[1] => Array
(
[key] => post_title
[value] => apple
[compare] => LIKE
)
[2] => Array
(
[relation] => OR
)
)
[title_filter] => apple
[title_filter_relation] => OR
[post_type] => product
)
</code></pre>
<p>Here is query</p>
<pre><code>SELECT SQL_CALC_FOUND_ROWS bhs_posts.ID
FROM bhs_posts INNER JOIN bhs_postmeta ON ( bhs_posts.ID = bhs_postmeta.post_id ) INNER JOIN bhs_postmeta AS mt1 ON ( bhs_posts.ID = mt1.post_id )
WHERE 1=1 AND (
bhs_posts.ID NOT IN (
SELECT object_id
FROM bhs_term_relationships
WHERE term_taxonomy_id IN (918)
)
) AND (
( bhs_postmeta.meta_key = '_stock_status' AND bhs_postmeta.meta_value = 'instock' )
AND
( mt1.meta_key = 'post_title' AND mt1.meta_value LIKE '{c914ad731b1921eeb5b858d7b618d23619ec92314bf850d67e343f6599dee9cc}apple{c914ad731b1921eeb5b858d7b618d23619ec92314bf850d67e343f6599dee9cc}' )
) AND ((bhs_posts.post_type = 'product' AND (bhs_posts.post_status = 'publish')))
GROUP BY bhs_posts.ID
ORDER BY bhs_posts.post_date DESC
LIMIT 0, 50
</code></pre>
<p>Database table:</p>
<p><a href="https://i.stack.imgur.com/B8h6M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B8h6M.png" alt="enter image description here" /></a></p>
<p>If I can make query like following then get proper result but I don't know how to change array in Wp</p>
<pre><code>SELECT SQL_CALC_FOUND_ROWS bhs_posts.ID
FROM bhs_posts INNER JOIN bhs_postmeta ON ( bhs_posts.ID = bhs_postmeta.post_id ) INNER JOIN bhs_postmeta AS mt1 ON ( bhs_posts.ID = mt1.post_id )
WHERE 1=1 AND (
bhs_posts.ID NOT IN (
SELECT object_id
FROM bhs_term_relationships
WHERE term_taxonomy_id IN (918)
)
) AND (
( bhs_postmeta.meta_key = '_stock_status' AND bhs_postmeta.meta_value = 'instock' )
AND
( bhs_posts.post_title LIKE 'apple%' )
) AND ((bhs_posts.post_type = 'product' AND (bhs_posts.post_status = 'publish')))
GROUP BY bhs_posts.ID
ORDER BY bhs_posts.post_date DESC
LIMIT 0, 50
</code></pre>
| [
{
"answer_id": 414351,
"author": "vijay pancholi",
"author_id": 138464,
"author_profile": "https://wordpress.stackexchange.com/users/138464",
"pm_score": 0,
"selected": false,
"text": "<pre><code>/* Use simple Query with s parameter */\n\n$args = array( \n 'post_type' => 'pr... | 2023/03/02 | [
"https://wordpress.stackexchange.com/questions/414324",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/190265/"
] | Here is my array which I am trying to get "apple" keyword in post table but it can't work like I want. Please let me know what is wrong with my array?
```
Array
(
[paged] => 1
[posts_per_page] => 50
[tax_query] => Array
(
[0] => Array
(
[taxonomy] => product_type
[field] => slug
[terms] => Array
(
[0] => chipin
)
[operator] => NOT IN
)
)
[status] => publish
[orderby] => date
[order] => DESC
[meta_query] => Array
(
[0] => Array
(
[key] => _stock_status
[value] => instock
)
[1] => Array
(
[key] => post_title
[value] => apple
[compare] => LIKE
)
[2] => Array
(
[relation] => OR
)
)
[title_filter] => apple
[title_filter_relation] => OR
[post_type] => product
)
```
Here is query
```
SELECT SQL_CALC_FOUND_ROWS bhs_posts.ID
FROM bhs_posts INNER JOIN bhs_postmeta ON ( bhs_posts.ID = bhs_postmeta.post_id ) INNER JOIN bhs_postmeta AS mt1 ON ( bhs_posts.ID = mt1.post_id )
WHERE 1=1 AND (
bhs_posts.ID NOT IN (
SELECT object_id
FROM bhs_term_relationships
WHERE term_taxonomy_id IN (918)
)
) AND (
( bhs_postmeta.meta_key = '_stock_status' AND bhs_postmeta.meta_value = 'instock' )
AND
( mt1.meta_key = 'post_title' AND mt1.meta_value LIKE '{c914ad731b1921eeb5b858d7b618d23619ec92314bf850d67e343f6599dee9cc}apple{c914ad731b1921eeb5b858d7b618d23619ec92314bf850d67e343f6599dee9cc}' )
) AND ((bhs_posts.post_type = 'product' AND (bhs_posts.post_status = 'publish')))
GROUP BY bhs_posts.ID
ORDER BY bhs_posts.post_date DESC
LIMIT 0, 50
```
Database table:
[](https://i.stack.imgur.com/B8h6M.png)
If I can make query like following then get proper result but I don't know how to change array in Wp
```
SELECT SQL_CALC_FOUND_ROWS bhs_posts.ID
FROM bhs_posts INNER JOIN bhs_postmeta ON ( bhs_posts.ID = bhs_postmeta.post_id ) INNER JOIN bhs_postmeta AS mt1 ON ( bhs_posts.ID = mt1.post_id )
WHERE 1=1 AND (
bhs_posts.ID NOT IN (
SELECT object_id
FROM bhs_term_relationships
WHERE term_taxonomy_id IN (918)
)
) AND (
( bhs_postmeta.meta_key = '_stock_status' AND bhs_postmeta.meta_value = 'instock' )
AND
( bhs_posts.post_title LIKE 'apple%' )
) AND ((bhs_posts.post_type = 'product' AND (bhs_posts.post_status = 'publish')))
GROUP BY bhs_posts.ID
ORDER BY bhs_posts.post_date DESC
LIMIT 0, 50
``` | You added **title** inside `$args['meta_query']` and that's why your query doesn't work.
Checking the [documentation](https://developer.wordpress.org/reference/classes/wp_query/parse_query/) (get\_posts / WP\_Query) you will find the available parameters, among them `title` and `s`.
```
$args = array(
's' => 'apple',
'post_type' => 'product'
//
// other parameters
// 'status`, 'orderby', 'meta_query', ...
)
$posts = get_posts($args);
```
If you use the `title` parameter - the exact match of the post title will be checked.
`bhs_posts.post_title = 'some text'`
If you use `s` parameter - (in simplification) the phrase will be splited and searched in the post title, content and excerpt .
```
((bhs_posts.post_title like '%some%' OR bhs_posts.post_excerpt like '%some%' OR bhs_posts.post_content like '%some%')
AND (bhs_posts.post_title like '%text%' OR bhs_posts.post_excerpt like '%text%' OR bhs_posts.post_content like '%text%'))
```
If you want to **search only in the title** of a post, you will need to use [posts\_search](https://developer.wordpress.org/reference/hooks/posts_search/) or [posts\_where](https://developer.wordpress.org/reference/hooks/posts_where/) filter to modify the query.
```
add_filter('posts_search', 'se414324_title_search', 100, 2)
function se414324_title_search( $search, $wp_query )
{
global $wpdb;
$qv = &$wp_query->query_vars;
if ( !isset($qv['wpse_title_search']) || 0 == strlen($qv['wpse_title_search']) )
return $search;
$like = $wpdb->esc_like( $qv['wpse_title_search'] ) . '%';
$search = $wpdb->prepare( " AND {$wpdb->posts}.post_title LIKE %s", $like );
return $search;
}
```
To modify only selected queries, and not all performed by WP, we use our own parameter name, here `wpse_title_search` in `$args` array.
```
$args = array(
'wpse_title_search' => 'apple',
'post_type' => 'product',
//
// other parameters
// 'status`, 'orderby', 'meta_query', ...
)
$myquery = new WP_Query($args);
```
OR
```
// "suppress_filters" is necessary for the filters to be applied
$args = array(
'wpse_title_search' => 'apple',
'post_type' => 'product',
'suppress_filters' => false,
//
// other parameters
// 'status`, 'orderby', 'meta_query', ...
)
$posts = get_posts($args);
``` |
414,329 | <p>I have been trying to migrate my html css and javascript static website to a wordpress dynamic theme. Everything worked fine and looks perfect but for some reason my font awesome icons appear as squares.</p>
<p>This is the website <a href="https://www.anasdahshan.me" rel="nofollow noreferrer">https://www.anasdahshan.me</a></p>
<p>if anyone can help me it would be great thank you so much.</p>
<pre><code><!-- Font Awesome Icon -->
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/all.min.css" />
</code></pre>
<pre><code> <ul class="social-icons ml-md-n2 justify-content-center justify-content-md-start">
<li class="social-icons-linkedin"><a data-toggle="tooltip" href="https://www.linkedin.com/in/" target="_blank" title="LinkedIn" data-original-title="LinkedIn"><i class="fab fa-linkedin"></i></a></li>
<li class="social-icons-github"><a data-toggle="tooltip" href="https://github.com/" target="_blank" title="Github" data-original-title="GitHub"><i class="fab fa-github"></i></a></li>
<li class="social-icons-twitter"><a data-toggle="tooltip" href="https://twitter.com/" target="_blank" title="Twitter" data-original-title="Twitter"><i class="fab fa-twitter"></i></a></li>
<li class="social-icons-instagram"><a data-toggle="tooltip" href="https://instagram.com/" target="_blank" title="Instagram" data-original-title="Instagram"><i class="fab fa-instagram"></i></a></li>
</ul>
</code></pre>
<p>Solution:
Just use the html code given with the font awesome kit without adding any php tags.</p>
<p>The html should be:</p>
<pre><code><link rel="stylesheet" href="https://kit.fontawesome.com/xxxxx.css" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/xxxxxxx.js" crossorigin="anonymous"></script>
</code></pre>
| [
{
"answer_id": 414339,
"author": "Alexander Holsgrove",
"author_id": 48962,
"author_profile": "https://wordpress.stackexchange.com/users/48962",
"pm_score": 0,
"selected": false,
"text": "<p>Your <a href=\"https://anasdahshan.me/wp-content/themes/wp-AnasDahshan/css/all.min.css\" rel=\"no... | 2023/03/02 | [
"https://wordpress.stackexchange.com/questions/414329",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/230460/"
] | I have been trying to migrate my html css and javascript static website to a wordpress dynamic theme. Everything worked fine and looks perfect but for some reason my font awesome icons appear as squares.
This is the website <https://www.anasdahshan.me>
if anyone can help me it would be great thank you so much.
```
<!-- Font Awesome Icon -->
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/all.min.css" />
```
```
<ul class="social-icons ml-md-n2 justify-content-center justify-content-md-start">
<li class="social-icons-linkedin"><a data-toggle="tooltip" href="https://www.linkedin.com/in/" target="_blank" title="LinkedIn" data-original-title="LinkedIn"><i class="fab fa-linkedin"></i></a></li>
<li class="social-icons-github"><a data-toggle="tooltip" href="https://github.com/" target="_blank" title="Github" data-original-title="GitHub"><i class="fab fa-github"></i></a></li>
<li class="social-icons-twitter"><a data-toggle="tooltip" href="https://twitter.com/" target="_blank" title="Twitter" data-original-title="Twitter"><i class="fab fa-twitter"></i></a></li>
<li class="social-icons-instagram"><a data-toggle="tooltip" href="https://instagram.com/" target="_blank" title="Instagram" data-original-title="Instagram"><i class="fab fa-instagram"></i></a></li>
</ul>
```
Solution:
Just use the html code given with the font awesome kit without adding any php tags.
The html should be:
```
<link rel="stylesheet" href="https://kit.fontawesome.com/xxxxx.css" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/xxxxxxx.js" crossorigin="anonymous"></script>
``` | Your [all.min.css](https://anasdahshan.me/wp-content/themes/wp-AnasDahshan/css/all.min.css) font is loaded onto your site, but can you please check you have a `webfonts` directory with files such as `fa-solid-900.woff` and `fa-solid-900.svg` - At the bottom of the all.min.css file you will see the @font-face declarations and the required paths relative to your CSS file eg `src:url(../webfonts/fa-solid-900.eot);`
The CSS class names and `font-family: "Font Awesome 5 Free"` look fine otherwise, so I suspect it's just a case of missing the font files (or the path being incorrect) |
616 | <p>We've had a number of questions like these lately: </p>
<ul>
<li><a href="https://workplace.stackexchange.com/questions/8765/how-to-handle-a-newcomer-getting-a-larger-stock-option-grant-than-myself-as-oldt">How to handle a newcomer getting a larger stock option grant than myself as oldtimer with the company? (self deleted, link is for 2k rep users only)</a></li>
<li><a href="https://workplace.stackexchange.com/questions/8759/how-should-i-respond-to-a-manager-apologizing/8760#8760">https://workplace.stackexchange.com/questions/8759/how-should-i-respond-to-a-manager-apologizing/8760#8760</a></li>
<li><a href="https://workplace.stackexchange.com/questions/8750/how-to-politely-prevent-coworkers-from-altering-ones-contributions-to-a-knowled">How to politely prevent coworkers from altering one's contributions to a knowledge base?</a></li>
</ul>
<p>I realize these questions are all different in terms of the events involved, but they all feel rather localized (and in a few questions, they're just plain wrong). </p>
<p>Do we really want to accept these questions that are all more or less fishing for 'how do I do what I really want to do in a polite way' vs. asking for actual advice?</p>
| [
{
"answer_id": 617,
"author": "Rachel",
"author_id": 316,
"author_profile": "https://workplace.meta.stackexchange.com/users/316",
"pm_score": 1,
"selected": false,
"text": "<p>I think questions that explain a common workplace situation, and ask us the best way to professionally handle th... | 2013/01/11 | [
"https://workplace.meta.stackexchange.com/questions/616",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/5086/"
] | We've had a number of questions like these lately:
* [How to handle a newcomer getting a larger stock option grant than myself as oldtimer with the company? (self deleted, link is for 2k rep users only)](https://workplace.stackexchange.com/questions/8765/how-to-handle-a-newcomer-getting-a-larger-stock-option-grant-than-myself-as-oldt)
* <https://workplace.stackexchange.com/questions/8759/how-should-i-respond-to-a-manager-apologizing/8760#8760>
* [How to politely prevent coworkers from altering one's contributions to a knowledge base?](https://workplace.stackexchange.com/questions/8750/how-to-politely-prevent-coworkers-from-altering-ones-contributions-to-a-knowled)
I realize these questions are all different in terms of the events involved, but they all feel rather localized (and in a few questions, they're just plain wrong).
Do we really want to accept these questions that are all more or less fishing for 'how do I do what I really want to do in a polite way' vs. asking for actual advice? | >
> Do we really want to accept these questions that are all more or less fishing for 'how do I do what I really want to do in a polite way' vs. asking for actual advice?
>
>
>
I have been thinking about this a fair bit. The main thing I keep coming back to is that a lot of these questions are the StackOverflow equivalent of "give me teh codez." Someone has a situation (or problem) they want guidance on.
It's no different to come here and post something which amounts to the workplace equivalent of this - "here's a situation I'm in, halp me plz what do i do." Most of them have no fundamental question outside of "what should I do?"
Our FAQ contains:
>
> You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page.
>
>
>
Questions with a basic question of, "what do I do?" don't meet this criteria almost always. There's normally never an actual problem - unless "I don't know what to do" is a problem.
---
The reason I am concerned with these types of questions is we can easily become an, "Ask The Workplace" site (like Dear Abby or all those columns) if we are not careful. Maybe this is ok. But if we choose to allow questions which have no fundamental question other than "help me please" this is precisely the type of Q/A site we will become.
---
```
See [here](http://meta.workplace.stackexchange.com/a/618/2322) for why this sort of post is not appropriate for The Workplace. Please read the [FAQ] to ensure you are asking an appropriate question, thanks!
``` |
2,411 | <p>You guys have gotten your own design! And with that, you now have the opportunity to setup Community Promotion Ads! We're still pretty fresh into 2014 so not much lost ground here.</p>
<h3>What are Community Promotion Ads?</h3>
<p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.</p>
<h3>Why do we have Community Promotion Ads?</h3>
<p>This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:</p>
<ul>
<li>the site's twitter account</li>
<li>at-the-office story blogs </li>
<li>cool events or conferences</li>
<li>anything else your community would genuinely be interested in</li>
</ul>
<p>The goal is for future visitors to find out about <em>the stuff your community deems important</em>. This also serves as a way to promote information and resources that are <em>relevant to your own community's interests</em>, both for those already in the community and those yet to join. </p>
<h3>Why do we reset the ads every year?</h3>
<p>Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.</p>
<p>The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.</p>
<h3>How does it work?</h3>
<p>The answers you post to this question <em>must</em> conform to the following rules, or they will be ignored. </p>
<ol>
<li><p>All answers should be in the exact form of:</p>
<pre><code>[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
</code></pre>
<p>Please <strong>do not add anything else to the body of the post</strong>. If you want to discuss something, do it in the comments.</p></li>
<li><p>The question must always be tagged with the magic <a href="/questions/tagged/community-ads" class="post-tag moderator-tag" title="show questions tagged 'community-ads'" rel="tag">community-ads</a> tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.</p></li>
</ol>
<h3>Image requirements</h3>
<ul>
<li>The image that you create must be <strong>220 x 250 pixels</strong></li>
<li>Must be hosted through our standard image uploader (imgur)</li>
<li>Must be GIF or PNG</li>
<li>No animated GIFs</li>
<li>Absolute limit on file size of 150 KB</li>
</ul>
<h3>Score Threshold</h3>
<p>There is a <strong>minimum score threshold</strong> an answer must meet (currently <strong>6</strong>) before it will be shown on the main site.</p>
<p>You can check out the ads that have met the threshold with basic click stats <a href="https://workplace.meta.stackexchange.com/ads/display/2411">here</a>.</p>
| [
{
"answer_id": 2412,
"author": "Grace Note",
"author_id": 154,
"author_profile": "https://workplace.meta.stackexchange.com/users/154",
"pm_score": 3,
"selected": false,
"text": "<p><a href=\"https://twitter.com/StackWorkplace\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur... | 2014/02/27 | [
"https://workplace.meta.stackexchange.com/questions/2411",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/154/"
] | You guys have gotten your own design! And with that, you now have the opportunity to setup Community Promotion Ads! We're still pretty fresh into 2014 so not much lost ground here.
### What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.
### Why do we have Community Promotion Ads?
This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:
* the site's twitter account
* at-the-office story blogs
* cool events or conferences
* anything else your community would genuinely be interested in
The goal is for future visitors to find out about *the stuff your community deems important*. This also serves as a way to promote information and resources that are *relevant to your own community's interests*, both for those already in the community and those yet to join.
### Why do we reset the ads every year?
Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.
The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.
### How does it work?
The answers you post to this question *must* conform to the following rules, or they will be ignored.
1. All answers should be in the exact form of:
```
[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
```
Please **do not add anything else to the body of the post**. If you want to discuss something, do it in the comments.
2. The question must always be tagged with the magic [community-ads](/questions/tagged/community-ads "show questions tagged 'community-ads'") tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.
### Image requirements
* The image that you create must be **220 x 250 pixels**
* Must be hosted through our standard image uploader (imgur)
* Must be GIF or PNG
* No animated GIFs
* Absolute limit on file size of 150 KB
### Score Threshold
There is a **minimum score threshold** an answer must meet (currently **6**) before it will be shown on the main site.
You can check out the ads that have met the threshold with basic click stats [here](https://workplace.meta.stackexchange.com/ads/display/2411). | [](http://startups.stackexchange.com) |
2,456 | <p><sup><a href="http://chat.stackexchange.com/transcript/message/14393594#14393594" title="'preferably @gnat or @Chad, or anyone else related to this whole hot question poor answer crusade that's been going on....'">Posted on behalf of jmac.</a></sup></p>
<p>The idea to test automating review of answers that fail to meet site-specific guidelines has been proposed by SE Community manager <a href="https://meta.stackexchange.com/a/226162/165773" title="Improving the System to Deal with Bad Answers">here</a>:</p>
<blockquote>
<p>let's test this first, see where it works and where it falls apart, and then implement the system that emerges. Pick a site you're active on and propose a campaign based on this process but using the existing tools: flag and ask for a notice to be added, flag again after <code>n</code> days and ask for the post to be removed. Track the results. </p>
</blockquote>
<p><strong>Can we please run proposed testing at Workplace?</strong></p>
<p>As far as I understand, for this we would need to establish a list of predefined flag messages / templates and agree upon how many days to wait prior to re-flagging for removal <a href="https://workplace.meta.stackexchange.com/questions/2456/testing-proposal-automating-review-of-answers-that-fail-to-meet-site-specific-g#comment4205_2456" title="as pointed in comments">if answer hasn't been improved</a>.</p>
<hr>
<p>Supplementary materials:</p>
<ul>
<li><a href="https://workplace.meta.stackexchange.com/questions/2403/improving-the-system-for-dealing-with-poor-answers">Improving the System for Dealing with Poor Answers</a>
<ul>
<li>MSO follow-up - <a href="https://meta.stackexchange.com/questions/224763/improving-the-system-to-deal-with-bad-answers"><em>Improving the System to Deal with Bad Answers</em></a></li>
<li>Water Cooler follow-up - <em><a href="http://chat.stackexchange.com/rooms/3060/conversation/post-notices-experiment-what-and-how-to-test">post notices experiment: what and how to test</a></em></li>
</ul></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/255/faq-proposal-back-it-up-and-dont-repeat-others">FAQ proposal: Back It Up and Don't Repeat Others</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2439/community-moderation-comments-template">Community moderation comments template</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2417/is-it-worth-creating-a-meta-so-proposal-for-custom-flags">Is it worth creating a meta.SO proposal for custom flags?</a></li>
</ul>
| [
{
"answer_id": 2459,
"author": "Monica Cellio",
"author_id": 325,
"author_profile": "https://workplace.meta.stackexchange.com/users/325",
"pm_score": 3,
"selected": false,
"text": "<p>Data we need to collect:</p>\n\n<ul>\n<li><p>What happens to answers that get this post notice? Possibl... | 2014/03/20 | [
"https://workplace.meta.stackexchange.com/questions/2456",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/168/"
] | [Posted on behalf of jmac.](http://chat.stackexchange.com/transcript/message/14393594#14393594 "'preferably @gnat or @Chad, or anyone else related to this whole hot question poor answer crusade that's been going on....'")
The idea to test automating review of answers that fail to meet site-specific guidelines has been proposed by SE Community manager [here](https://meta.stackexchange.com/a/226162/165773 "Improving the System to Deal with Bad Answers"):
>
> let's test this first, see where it works and where it falls apart, and then implement the system that emerges. Pick a site you're active on and propose a campaign based on this process but using the existing tools: flag and ask for a notice to be added, flag again after `n` days and ask for the post to be removed. Track the results.
>
>
>
**Can we please run proposed testing at Workplace?**
As far as I understand, for this we would need to establish a list of predefined flag messages / templates and agree upon how many days to wait prior to re-flagging for removal [if answer hasn't been improved](https://workplace.meta.stackexchange.com/questions/2456/testing-proposal-automating-review-of-answers-that-fail-to-meet-site-specific-g#comment4205_2456 "as pointed in comments").
---
Supplementary materials:
* [Improving the System for Dealing with Poor Answers](https://workplace.meta.stackexchange.com/questions/2403/improving-the-system-for-dealing-with-poor-answers)
+ MSO follow-up - [*Improving the System to Deal with Bad Answers*](https://meta.stackexchange.com/questions/224763/improving-the-system-to-deal-with-bad-answers)
+ Water Cooler follow-up - *[post notices experiment: what and how to test](http://chat.stackexchange.com/rooms/3060/conversation/post-notices-experiment-what-and-how-to-test)*
* [FAQ proposal: Back It Up and Don't Repeat Others](https://workplace.meta.stackexchange.com/questions/255/faq-proposal-back-it-up-and-dont-repeat-others)
* [Community moderation comments template](https://workplace.meta.stackexchange.com/questions/2439/community-moderation-comments-template)
* [Is it worth creating a meta.SO proposal for custom flags?](https://workplace.meta.stackexchange.com/questions/2417/is-it-worth-creating-a-meta-so-proposal-for-custom-flags) | As pointed out, this can't be done with the Data Explorer unfortunately. We will need some community manager help to get the data, but we can lay out what sort of data we want.
What are we trying to find out?
-------------------------------
*"Are post notices successful?"* is the question we're trying to answer.
What is success?
----------------
This is where things get sticky, but I'd advocate the following measures of success for post notices:
1. Post notices result in **more successful edits** of answers with them
2. Post notices **clearly indicate poor posts** that should be deleted if not edited
Like with putting question 'on hold', our goal for putting post notices would be to give the answer a chance to be improved, and if not, indicate that it is a good candidate to be removed.
How can we measure that?
------------------------
We should gather the following information:
1. # of answers
2. # of edited answers
3. # of successful edits
4. # of edited answers deleted
5. # of non-edited answers deleted
This will allow us to see if we are improving the rate of edits, the quality of edits, and whether the edits are capable of saving the posts from deletion or not.
We need to compare to a baseline. I suggest comparing the following three categories:
1. Answers with a post notice (test case)
2. Answers with >=1 downvote, negative score, and a comment
3. Answers with >=1 downvote, negative score
Summary
-------
Get a table like this:
```
# answers | # edited | # successful edits | # edited/del | # non-edited/del
Post Notice
DV + Comment
All Answers
``` |
2,748 | <p>our name is The Workplace, and we have a comment problem.</p>
<ol>
<li>We definitely have a comment problem</li>
<li>We have tried to fix it, but haven't succeeded yet</li>
<li>We want your help to figure out a way to do that</li>
</ol>
<h3>We have a growing comment problem:</h3>
<p>This is our comments by week since the Workplace started out:</p>
<blockquote>
<p><a href="http://data.stackexchange.com/workplace/query/edit/207645#graph" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9tPWZ.png" alt="Comments by Week" /></a></p>
</blockquote>
<p>As you can see, from January this year we have seen a marked increase in the number of comments we are getting. Bear in mind this does <em>not</em> include deleted comments, of which there are many hundred per week that are being deleted.</p>
<p>For a more specific example, at the time of this edit, <a href="https://workplace.stackexchange.com/questions/30533/is-there-a-dress-code-for-women-in-software-industry">this question</a> is 15 hours old and already has <strong>59 comments</strong>. Currently none are deleted. Take a look and tell me that all these comments are appropriate and useful to high-quality Q&A.</p>
<h3>What we've tried</h3>
<p>We have <a href="https://workplace.meta.stackexchange.com/questions/72/what-comments-are-not">tried explaining what comments are for</a>:</p>
<blockquote>
<p>Comments are not intended for long-term storage of important information. But that transiency doesn't mean you can use comments for random, parenthetical asides. <strong>If your comment isn't likely to change the content of the post, please do not post it</strong> for someone else to clean up. Thanks.</p>
</blockquote>
<p>We have tried <a href="https://workplace.meta.stackexchange.com/questions/2691/get-a-room-a-chat-room">recommending chat instead</a>:</p>
<blockquote>
<p>Chat is an underused tool on The Workplace, yet we have users in our community with over 300 comments posted in just a 30 day period. The evidence speaks for itself; people like to chat. Yet, comments on the Q&A site leads to a lot of unnecessary cleanup, not just for moderators but for all of our diligent community flaggers who work tirelessly to help keep the clutter under control.</p>
</blockquote>
<p>But yet we still get a whole lot of comments, and plenty of meta posts trying to ask the community what to do about them:</p>
<ul>
<li><a href="https://workplace.meta.stackexchange.com/questions/2701/">Best ways to address comments?</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2685/is-it-appropriate-to-leave-a-comment-which-is-a-general-remark-on-the-question">Is it appropriate to leave a comment which is a general remark on the question?</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2634/are-1-for-something-about-the-post-comments-discouraged">Are '+1 for [something about the post]' comments discouraged?</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2691/get-a-room-a-chat-room">Get a Room, a Chat Room!</a></li>
<li><a href="https://workplace.meta.stackexchange.com/questions/2743/why-suddenly-all-comments-are-started-to-disappear">Why did all comments suddenly start disappearing?</a></li>
</ul>
<p>These are just the posts in <a href="/questions/tagged/comments" class="post-tag" title="show questions tagged 'comments'" rel="tag">comments</a> since April!</p>
<h3>What can be done?</h3>
<p>I would like you guys to let us know what can be done to prevent comments from drowning out the core information on the site: questions and answers. As explained in the <a href="https://workplace.stackexchange.com/help/privileges/comment">help center</a> for every SE site:</p>
<blockquote>
<p>You should submit a comment if you want to:</p>
<ul>
<li>Request <strong>clarification</strong> from the author;</li>
<li>Leave <strong>constructive criticism</strong> that guides the author in improving the post;</li>
<li>Add relevant but <strong>minor or transient information</strong> to a post (e.g. a link to a related question, or an alert to the author that the question has been updated).</li>
</ul>
</blockquote>
<p>We definitely are getting far more comments that isn't in one of those categories than in it, and that is creating noise for people seeking our high-quality answers, and adding additional burdens to the community on flagging and cleanup.</p>
<p>How can we solve this problem short of turning off commenting?</p>
| [
{
"answer_id": 2750,
"author": "Joe Strazzere",
"author_id": 7777,
"author_profile": "https://workplace.meta.stackexchange.com/users/7777",
"pm_score": 4,
"selected": false,
"text": "<p>I completely agree with @aroth.</p>\n\n<p>The label \"add comment\" causes people to react the same wa... | 2014/07/10 | [
"https://workplace.meta.stackexchange.com/questions/2748",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/7945/"
] | our name is The Workplace, and we have a comment problem.
1. We definitely have a comment problem
2. We have tried to fix it, but haven't succeeded yet
3. We want your help to figure out a way to do that
### We have a growing comment problem:
This is our comments by week since the Workplace started out:
>
> [](http://data.stackexchange.com/workplace/query/edit/207645#graph)
>
>
>
As you can see, from January this year we have seen a marked increase in the number of comments we are getting. Bear in mind this does *not* include deleted comments, of which there are many hundred per week that are being deleted.
For a more specific example, at the time of this edit, [this question](https://workplace.stackexchange.com/questions/30533/is-there-a-dress-code-for-women-in-software-industry) is 15 hours old and already has **59 comments**. Currently none are deleted. Take a look and tell me that all these comments are appropriate and useful to high-quality Q&A.
### What we've tried
We have [tried explaining what comments are for](https://workplace.meta.stackexchange.com/questions/72/what-comments-are-not):
>
> Comments are not intended for long-term storage of important information. But that transiency doesn't mean you can use comments for random, parenthetical asides. **If your comment isn't likely to change the content of the post, please do not post it** for someone else to clean up. Thanks.
>
>
>
We have tried [recommending chat instead](https://workplace.meta.stackexchange.com/questions/2691/get-a-room-a-chat-room):
>
> Chat is an underused tool on The Workplace, yet we have users in our community with over 300 comments posted in just a 30 day period. The evidence speaks for itself; people like to chat. Yet, comments on the Q&A site leads to a lot of unnecessary cleanup, not just for moderators but for all of our diligent community flaggers who work tirelessly to help keep the clutter under control.
>
>
>
But yet we still get a whole lot of comments, and plenty of meta posts trying to ask the community what to do about them:
* [Best ways to address comments?](https://workplace.meta.stackexchange.com/questions/2701/)
* [Is it appropriate to leave a comment which is a general remark on the question?](https://workplace.meta.stackexchange.com/questions/2685/is-it-appropriate-to-leave-a-comment-which-is-a-general-remark-on-the-question)
* [Are '+1 for [something about the post]' comments discouraged?](https://workplace.meta.stackexchange.com/questions/2634/are-1-for-something-about-the-post-comments-discouraged)
* [Get a Room, a Chat Room!](https://workplace.meta.stackexchange.com/questions/2691/get-a-room-a-chat-room)
* [Why did all comments suddenly start disappearing?](https://workplace.meta.stackexchange.com/questions/2743/why-suddenly-all-comments-are-started-to-disappear)
These are just the posts in [comments](/questions/tagged/comments "show questions tagged 'comments'") since April!
### What can be done?
I would like you guys to let us know what can be done to prevent comments from drowning out the core information on the site: questions and answers. As explained in the [help center](https://workplace.stackexchange.com/help/privileges/comment) for every SE site:
>
> You should submit a comment if you want to:
>
>
> * Request **clarification** from the author;
> * Leave **constructive criticism** that guides the author in improving the post;
> * Add relevant but **minor or transient information** to a post (e.g. a link to a related question, or an alert to the author that the question has been updated).
>
>
>
We definitely are getting far more comments that isn't in one of those categories than in it, and that is creating noise for people seeking our high-quality answers, and adding additional burdens to the community on flagging and cleanup.
How can we solve this problem short of turning off commenting? | Does The Workplace have a particular problem with comment volume?
-----------------------------------------------------------------
I looked at the ratio of comments to posts (including deleted of both) and tallied up the sites on the network that average more than 2.5 comments per post:
```
C/P Site
--- ----
4.08 Skeptics
3.8 Politics
3.06 Jewish Life and Learning
3.06 History
2.94 Mathematica
2.87 Puzzling Stack Exchange
2.81 Linguistics
2.78 Christianity
2.75 The Workplace
2.72 Theoretical Computer Science
2.63 Philosophy
2.57 MathOverflow
2.52 Code Golf
```
The list included quite a few meta sites that I removed (notably The Workplace Meta at 2.86) because most sites have more commenty meta than main sites. This isn't surprising because meta tends to be more discussion-oriented than factually-oriented. The bottom of the list is largely populated with sites that died of lack of activity or are dying and have fewer than 1 comment per post.
Considering the place workplace issues have on the [scale of subjectivity](http://blog.stackoverflow.com/2010/09/good-subjective-bad-subjective/), the volume of comments per post here doesn't seem too extreme. (The math-related sites are somewhat of an anomaly. They rely heavily on [comments for collaboration](https://meta.mathoverflow.net/a/247/36770).) It's natural that more comments will be needed to clarify questions and answers when the subject has no independent method of verifying the truth of assertions.
Is the problem growing?
-----------------------
Well, it depends on how you look at it. I've forked your query and added a couple more lines:
[](http://data.stackexchange.com/workplace/query/207674/comments-per-week#graph)
The green `C_per_P_100` line is comments per post multiplied by 100 so that it will fit on the sameish scale. Comments per post has held steady while number of questions and answers has increased smartly since the beginning of the year. It's not so much that people are getting more commenty as that there are more things to comment on.
Does this mean there's no comment problem?
------------------------------------------
Not at all. There are a few things I haven't looked at that might be a problem:
1. Comment distribution
If comments were spread evenly, 2.75 comments on each and every post seems not overwhelming. But if a few questions gather many comments (like [How do you decide when to go home for the day?](https://workplace.stackexchange.com/questions/28338/how-do-you-decide-when-to-go-home-for-the-day)) the problem can be quite noticable. For moderators especially, the automated ["too many comments"](https://meta.stackexchange.com/q/144694/1438) flag ensures that such posts are noticed.
2. Comment length
A few short comments are less problematic (at least in terms of space used) compared to the same number of long comments. We are working on making [single-line comments take just one line](https://meta.stackexchange.com/questions/235255/proposed-tweak-to-comment-ui-for-long-threads), which could further reduce the space consumed by short comments. (On the other hand, [long comments tend to be higher quality](https://meta.stackexchange.com/questions/204402/hide-trivial-comments). See the next point.)
3. Comment quality
I tend to think that comments on Skeptics, Mi Yodeya, Christianity, History, and Philosophy (the sites on the 2.5+ comments per post list that I'm familiar with) are fairly constructive on the whole. There aren't many [+1 comments](https://workplace.meta.stackexchange.com/questions/2634/are-1-for-something-about-the-post-comments-discouraged) as I recall. If comments are mostly of the chatty sort on The Workplace and not helpful in clarifying the post they are attached to, there could very well be a growing problem that's not reflected in any statistic. Given my reading of the linked meta posts, it sounds as if the quality of comments, rather than their volume *per se*, is the problem here.
Summary
-------
In order to solve a problem with comments, we need to clearly identify what, precisely, the problem is. My look at the data suggests that The Workplace includes more prolific commentary than most sites, but not excessively more. On the other hand, if comments distract from rather than augment the prime mission of a Q&A site, we may need to explore aggressive corrections. |
2,938 | <p>While adding tags to a question I asked, I noticed that the box that displays as you type in a tag was getting cut off. Also, the list of "Similar Questions" was overflowing down to the bottom of the page (where the links to different SE sites are). Here is a screenshot to better explain:</p>
<p><kbd><img src="https://i.stack.imgur.com/vYwvs.png" alt="enter image description here"></kbd></p>
<p><strong>EDIT:</strong> I am using Firefox 32.0.2 on Windows 7, 64-bit.</p>
| [
{
"answer_id": 3081,
"author": "Ilmari Karonen",
"author_id": 2139,
"author_profile": "https://workplace.meta.stackexchange.com/users/2139",
"pm_score": 3,
"selected": false,
"text": "<p>The tag menu cutoff happens because the style sheet here on workplace.SE styles the <code>#content</c... | 2014/09/12 | [
"https://workplace.meta.stackexchange.com/questions/2938",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/16723/"
] | While adding tags to a question I asked, I noticed that the box that displays as you type in a tag was getting cut off. Also, the list of "Similar Questions" was overflowing down to the bottom of the page (where the links to different SE sites are). Here is a screenshot to better explain:
``
**EDIT:** I am using Firefox 32.0.2 on Windows 7, 64-bit. | The tag menu cutoff happens because the style sheet here on workplace.SE styles the `#content` element as `overflow: hidden`. Simply overriding that style with:
```
#content { overflow: visible }
```
is enough to fix it.
(However, I'm a bit worried that the `overflow: hidden` style may have been added for a reason, possibly to fix some other unrelated problem somewhere else. This needs a bit more testing.)
**Update:** OK, so there *is* a pretty obvious reason for the `overflow: hidden`; without it, the content area will not expand to contain all floated elements (like, say, the mainbar and the sidebar) inside it, causing the white background to cut off halfway through the page.
Fortunately, there's a simple fix: we just need to add a *non-floating* element at the end of the `#content` div, styled with `clear: both`. And even more conveniently, we can do this with pure CSS:
```
#content:after { content: ' '; display: block; height: 0; clear: both }
```
---
As for the sidebar extending into the footer, that's not really specific to this site; it happens on every SE site, but it just looks uglier here, because the sidebar here has a transparent background. Giving it a white background with:
```
#scroller { background: white; border-radius: 5px }
```
makes it slightly less ugly. (The `border-radius` is just a finishing touch, to make it fit better with the general rounded design here.)
I've added these styles to the devel branch of [SOUP](https://stackapps.com/questions/4486/stack-overflow-unofficial-patch); unless further breakage shows up, or unless these bugs get properly fixed in the mean time, they'll be part of the next stable SOUP version, v1.30.
Here's what asking a question looks like to me with these fixes:
[](https://i.stack.imgur.com/xBOEm.png) |
3,023 | <p>The dawn of a new year, 2015, now approaches, or has already approached, either way it means that it is now time for the site's first new cycle of Community Promotion Ads!</p>
<h3>What are Community Promotion Ads?</h3>
<p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.</p>
<h3>Why do we have Community Promotion Ads?</h3>
<p>This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:</p>
<ul>
<li>the site's twitter account</li>
<li>at-the-office story blogs </li>
<li>cool events or conferences</li>
<li>anything else your community would genuinely be interested in</li>
</ul>
<p>The goal is for future visitors to find out about <em>the stuff your community deems important</em>. This also serves as a way to promote information and resources that are <em>relevant to your own community's interests</em>, both for those already in the community and those yet to join. </p>
<h3>Why do we reset the ads every year?</h3>
<p>Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.</p>
<p>The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.</p>
<h3>How does it work?</h3>
<p>The answers you post to this question <em>must</em> conform to the following rules, or they will be ignored. </p>
<ol>
<li><p>All answers should be in the exact form of:</p>
<pre><code>[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
</code></pre>
<p>Please <strong>do not add anything else to the body of the post</strong>. If you want to discuss something, do it in the comments.</p></li>
<li><p>The question must always be tagged with the magic <a href="/questions/tagged/community-ads" class="post-tag moderator-tag" title="show questions tagged 'community-ads'" rel="tag">community-ads</a> tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.</p></li>
</ol>
<h3>Image requirements</h3>
<ul>
<li>The image that you create must be <strong>220 x 250 pixels</strong></li>
<li>Must be hosted through our standard image uploader (imgur)</li>
<li>Must be GIF or PNG</li>
<li>No animated GIFs</li>
<li>Absolute limit on file size of 150 KB</li>
</ul>
<h3>Score Threshold</h3>
<p>There is a <strong>minimum score threshold</strong> an answer must meet (currently <strong>6</strong>) before it will be shown on the main site.</p>
<p>You can check out the ads that have met the threshold with basic click stats <a href="https://workplace.meta.stackexchange.com/ads/display/3023">here</a>.</p>
| [
{
"answer_id": 3024,
"author": "Grace Note",
"author_id": 154,
"author_profile": "https://workplace.meta.stackexchange.com/users/154",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"https://twitter.com/StackWorkplace\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur... | 2015/01/01 | [
"https://workplace.meta.stackexchange.com/questions/3023",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/154/"
] | The dawn of a new year, 2015, now approaches, or has already approached, either way it means that it is now time for the site's first new cycle of Community Promotion Ads!
### What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.
### Why do we have Community Promotion Ads?
This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:
* the site's twitter account
* at-the-office story blogs
* cool events or conferences
* anything else your community would genuinely be interested in
The goal is for future visitors to find out about *the stuff your community deems important*. This also serves as a way to promote information and resources that are *relevant to your own community's interests*, both for those already in the community and those yet to join.
### Why do we reset the ads every year?
Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.
The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.
### How does it work?
The answers you post to this question *must* conform to the following rules, or they will be ignored.
1. All answers should be in the exact form of:
```
[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
```
Please **do not add anything else to the body of the post**. If you want to discuss something, do it in the comments.
2. The question must always be tagged with the magic [community-ads](/questions/tagged/community-ads "show questions tagged 'community-ads'") tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.
### Image requirements
* The image that you create must be **220 x 250 pixels**
* Must be hosted through our standard image uploader (imgur)
* Must be GIF or PNG
* No animated GIFs
* Absolute limit on file size of 150 KB
### Score Threshold
There is a **minimum score threshold** an answer must meet (currently **6**) before it will be shown on the main site.
You can check out the ads that have met the threshold with basic click stats [here](https://workplace.meta.stackexchange.com/ads/display/3023). | [](http://startups.stackexchange.com) |
4,284 | <p>It is a bit late into this new year, being that we're already in the second month, but we are now cycling the Community Promotion Ads for 2017!</p>
<h3>What are Community Promotion Ads?</h3>
<p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.</p>
<h3>Why do we have Community Promotion Ads?</h3>
<p>This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:</p>
<ul>
<li>the site's twitter account</li>
<li>at-the-office story blogs</li>
<li>cool events or conferences</li>
<li>anything else your community would genuinely be interested in</li>
</ul>
<p>The goal is for future visitors to find out about <em>the stuff your community deems important</em>. This also serves as a way to promote information and resources that are <em>relevant to your own community's interests</em>, both for those already in the community and those yet to join. </p>
<h3>Why do we reset the ads every year?</h3>
<p>Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.</p>
<p>The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.</p>
<h3>How does it work?</h3>
<p>The answers you post to this question <em>must</em> conform to the following rules, or they will be ignored. </p>
<ol>
<li><p>All answers should be in the exact form of:</p>
<pre><code>[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
</code></pre>
<p>Please <strong>do not add anything else to the body of the post</strong>. If you want to discuss something, do it in the comments.</p></li>
<li><p>The question must always be tagged with the magic <a href="/questions/tagged/community-ads" class="post-tag moderator-tag" title="show questions tagged 'community-ads'" rel="tag">community-ads</a> tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.</p></li>
</ol>
<h3>Image requirements</h3>
<ul>
<li>The image that you create must be 300 x 250 pixels, or double that if high DPI.</li>
<li>Must be hosted through our standard image uploader (imgur)</li>
<li>Must be GIF or PNG</li>
<li>No animated GIFs</li>
<li>Absolute limit on file size of 150 KB</li>
<li>If the background of the image is white or partially white, there must be a 1px border (2px if high DPI) surrounding it.</li>
</ul>
<h3>Score Threshold</h3>
<p>There is a <strong>minimum score threshold</strong> an answer must meet (currently <strong>6</strong>) before it will be shown on the main site.</p>
<p>You can check out the ads that have met the threshold with basic click stats <a href="https://workplace.meta.stackexchange.com/ads/display/4284">here</a>.</p>
| [
{
"answer_id": 4285,
"author": "Grace Note",
"author_id": 154,
"author_profile": "https://workplace.meta.stackexchange.com/users/154",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"https://twitter.com/StackWorkplace\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur... | 2017/02/02 | [
"https://workplace.meta.stackexchange.com/questions/4284",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/154/"
] | It is a bit late into this new year, being that we're already in the second month, but we are now cycling the Community Promotion Ads for 2017!
### What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.
### Why do we have Community Promotion Ads?
This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:
* the site's twitter account
* at-the-office story blogs
* cool events or conferences
* anything else your community would genuinely be interested in
The goal is for future visitors to find out about *the stuff your community deems important*. This also serves as a way to promote information and resources that are *relevant to your own community's interests*, both for those already in the community and those yet to join.
### Why do we reset the ads every year?
Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.
The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.
### How does it work?
The answers you post to this question *must* conform to the following rules, or they will be ignored.
1. All answers should be in the exact form of:
```
[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
```
Please **do not add anything else to the body of the post**. If you want to discuss something, do it in the comments.
2. The question must always be tagged with the magic [community-ads](/questions/tagged/community-ads "show questions tagged 'community-ads'") tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.
### Image requirements
* The image that you create must be 300 x 250 pixels, or double that if high DPI.
* Must be hosted through our standard image uploader (imgur)
* Must be GIF or PNG
* No animated GIFs
* Absolute limit on file size of 150 KB
* If the background of the image is white or partially white, there must be a 1px border (2px if high DPI) surrounding it.
### Score Threshold
There is a **minimum score threshold** an answer must meet (currently **6**) before it will be shown on the main site.
You can check out the ads that have met the threshold with basic click stats [here](https://workplace.meta.stackexchange.com/ads/display/4284). | [](http://area51.stackexchange.com/proposals/92736/interpersonal-skills) |
5,032 | <p>It's almost February in 2018, which isn't supposed to be the proper time to cycle these, but for this year it'll be once again, so we'll be refreshing the <strong>Community Promotion Ads</strong> for this year now!</p>
<h3>What are Community Promotion Ads?</h3>
<p>Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.</p>
<h3>Why do we have Community Promotion Ads?</h3>
<p>This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:</p>
<ul>
<li>the site's twitter account</li>
<li>at-the-office story blogs</li>
<li>cool events or conferences</li>
<li>anything else your community would genuinely be interested in</li>
</ul>
<p>The goal is for future visitors to find out about <em>the stuff your community deems important</em>. This also serves as a way to promote information and resources that are <em>relevant to your own community's interests</em>, both for those already in the community and those yet to join. </p>
<h3>Why do we reset the ads every year?</h3>
<p>Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.</p>
<p>The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.</p>
<h3>How does it work?</h3>
<p>The answers you post to this question <em>must</em> conform to the following rules, or they will be ignored. </p>
<ol>
<li><p>All answers should be in the exact form of:</p>
<pre><code>[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
</code></pre>
<p>Please <strong>do not add anything else to the body of the post</strong>. If you want to discuss something, do it in the comments.</p></li>
<li><p>The question must always be tagged with the magic <a href="/questions/tagged/community-ads" class="post-tag moderator-tag" title="show questions tagged 'community-ads'" rel="tag">community-ads</a> tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.</p></li>
</ol>
<h3>Image requirements</h3>
<ul>
<li>The image that you create must be 300 x 250 pixels, or double that if high DPI.</li>
<li>Must be hosted through our standard image uploader (imgur)</li>
<li>Must be GIF or PNG</li>
<li>No animated GIFs</li>
<li>Absolute limit on file size of 150 KB</li>
<li>If the background of the image is white or partially white, there must be a 1px border (2px if high DPI) surrounding it.</li>
</ul>
<h3>Score Threshold</h3>
<p>There is a <strong>minimum score threshold</strong> an answer must meet (currently <strong>6</strong>) before it will be shown on the main site.</p>
<p>You can check out the ads that have met the threshold with basic click stats <a href="https://workplace.meta.stackexchange.com/ads/display/5032">here</a>.</p>
| [
{
"answer_id": 5033,
"author": "Grace Note",
"author_id": 154,
"author_profile": "https://workplace.meta.stackexchange.com/users/154",
"pm_score": 0,
"selected": false,
"text": "<p><a href=\"https://twitter.com/StackWorkplace\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur... | 2018/01/29 | [
"https://workplace.meta.stackexchange.com/questions/5032",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/154/"
] | It's almost February in 2018, which isn't supposed to be the proper time to cycle these, but for this year it'll be once again, so we'll be refreshing the **Community Promotion Ads** for this year now!
### What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The purpose of this question is the vetting process. Images of the advertisements are provided, and community voting will enable the advertisements to be shown.
### Why do we have Community Promotion Ads?
This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:
* the site's twitter account
* at-the-office story blogs
* cool events or conferences
* anything else your community would genuinely be interested in
The goal is for future visitors to find out about *the stuff your community deems important*. This also serves as a way to promote information and resources that are *relevant to your own community's interests*, both for those already in the community and those yet to join.
### Why do we reset the ads every year?
Some services will maintain usefulness over the years, while other things will wane to allow for new faces to show up. Resetting the ads every year helps accommodate this, and allows old ads that have served their purpose to be cycled out for fresher ads for newer things. This helps keep the material in the ads relevant to not just the subject matter of the community, but to the current status of the community. We reset the ads once a year, every December.
The community promotion ads have no restrictions against reposting an ad from a previous cycle. If a particular service or ad is very valuable to the community and will continue to be so, it is a good idea to repost it. It may be helpful to give it a new face in the process, so as to prevent the imagery of the ad from getting stale after a year of exposure.
### How does it work?
The answers you post to this question *must* conform to the following rules, or they will be ignored.
1. All answers should be in the exact form of:
```
[![Tagline to show on mouseover][1]][2]
[1]: http://image-url
[2]: http://clickthrough-url
```
Please **do not add anything else to the body of the post**. If you want to discuss something, do it in the comments.
2. The question must always be tagged with the magic [community-ads](/questions/tagged/community-ads "show questions tagged 'community-ads'") tag. In addition to enabling the functionality of the advertisements, this tag also pre-fills the answer form with the above required form.
### Image requirements
* The image that you create must be 300 x 250 pixels, or double that if high DPI.
* Must be hosted through our standard image uploader (imgur)
* Must be GIF or PNG
* No animated GIFs
* Absolute limit on file size of 150 KB
* If the background of the image is white or partially white, there must be a 1px border (2px if high DPI) surrounding it.
### Score Threshold
There is a **minimum score threshold** an answer must meet (currently **6**) before it will be shown on the main site.
You can check out the ads that have met the threshold with basic click stats [here](https://workplace.meta.stackexchange.com/ads/display/5032). | [](https://area51.stackexchange.com/proposals/110851/sales-and-marketing)
(source: [stackexchange.com](https://area51.stackexchange.com/ads/proposal/110851.png)) |
6,486 | <p>It's New Year's Day in <a href="https://en.wikipedia.org/wiki/Zulu_Time" rel="nofollow noreferrer">Stack Exchange land</a>...</p>
<p>A distinguishing characteristic of these sites is how they are moderated:</p>
<blockquote>
<p>We designed the Stack Exchange network engine to be mostly self-regulating, in that we amortize the overall moderation cost of the system across thousands of teeny-tiny slices of effort contributed by regular, everyday users.<br>
-- <a href="http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/">A Theory of Moderation</a></p>
</blockquote>
<p>While there certainly are <a href="https://stackoverflow.blog/2018/11/21/our-theory-of-moderation-re-visited/">Moderators</a> here, a significant amount of the <em>moderation</em> is done by ordinary people, using the privileges
they've earned by virtue of their contributions to the site. Each of you contributes a little bit of time and effort, and together you accomplish much.</p>
<p>As we enter a new year, let's pause and reflect, taking a moment to appreciate the work that we do here together.
And what could be more festive than a big pile of numbers?
So here is a breakdown of moderation actions performed on The Workplace over the past 12 months:</p>
<pre><code> Action Moderators Community¹
----------------------------------------- ---------- ----------
Users suspended² 19 29
Users destroyed³ 9 0
Users deleted 5 0
Users contacted 52 11
Tasks reviewed⁴: Suggested Edit queue 49 4,051
Tasks reviewed⁴: Reopen Vote queue 0 2,623
Tasks reviewed⁴: Low Quality Posts queue 14 1,139
Tasks reviewed⁴: Late Answer queue 0 152
Tasks reviewed⁴: First Post queue 0 4,364
Tasks reviewed⁴: Close Votes queue 4 12,029
Tags merged 10 0
Tag synonyms proposed 1 2
Tag synonyms created 2 3
Revisions redacted 2 1
Questions unprotected 0 2
Questions reopened 10 162
Questions protected 109 227
Questions migrated 8 2
Questions merged 2 0
Questions flagged⁵ 11 3,194
Questions closed 189 1,642
Question flags handled⁵ 791 2,410
Posts unlocked 2 25
Posts undeleted 18 98
Posts locked 16 318
Posts deleted⁶ 237 2,182
Posts bumped 0 10
Escalations to the Community Manager team 8 4
Comments undeleted 142 12
Comments flagged 70 9,712
Comments deleted⁷ 12,938 13,821
Comment flags handled 5,769 4,016
Answers flagged 32 2,032
Answer flags handled 960 1,101
All comments on a post moved to chat 292 115
</code></pre>
<h3>Footnotes</h3>
<p>¹ "Community" here refers both to <a href="https://workplace.stackexchange.com/users">the membership of The Workplace</a> <em>without</em> <a href="https://workplace.stackexchange.com/users?tab=moderators">diamonds next to their names</a>, and to the automated systems otherwise known as <a href="https://workplace.stackexchange.com/users/-1">user #-1</a>.</p>
<p>² The system will suspend users under three circumstances: when a user is recreated after being previously suspended, when a user is recreated after being destroyed for spam or abuse, and when a network-wide suspension is in effect on an account.</p>
<p>³ A "destroyed" user is deleted along with all that they had posted: questions, answers, comments. <a href="https://meta.stackexchange.com/questions/88994/what-is-the-difference-between-a-deleted-user-and-a-destroyed-user">Generally used as an expedient way of getting rid of spam.</a></p>
<p>⁴ This counts every review that was submitted (not skipped) - so the 2 suggested edits reviews needed to approve an edit would count as 2, the goal being to indicate the frequency of moderation actions. This also applies to flags, etc.</p>
<p>⁵ Includes close flags (but <em>not</em> close or reopen votes).</p>
<p>⁶ This ignores numerous deletions that happen automatically in response to some other action.</p>
<p>⁷ This includes comments deleted by their own authors (which also account for some number of handled comment flags). </p>
<h3>Further reading:</h3>
<ul>
<li><p>Wanna see how these numbers have changed over time? I posted a similar report here last year: <a href="https://workplace.meta.stackexchange.com/questions/5851/2018-a-year-in-moderation">2018: a year in moderation</a>...</p></li>
<li><p>You can also check out <a href="https://stackexchange.com/search?q=title%3A%222019%3A+a+year+in+moderation%22">this report on other sites</a></p></li>
<li>Or peruse <a href="https://meta.stackexchange.com/questions/341507/2019-a-year-in-closing">detailed information on the number of questions closed and reopened across all sites</a></li>
</ul>
<p>Wishing you all a happy new year...</p>
| [
{
"answer_id": 6489,
"author": "gnat",
"author_id": 168,
"author_profile": "https://workplace.meta.stackexchange.com/users/168",
"pm_score": 4,
"selected": false,
"text": "<p>I think this summary would be incomplete without mentioning the fact that in 2019 our site lost three out of five... | 2020/01/01 | [
"https://workplace.meta.stackexchange.com/questions/6486",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/115/"
] | It's New Year's Day in [Stack Exchange land](https://en.wikipedia.org/wiki/Zulu_Time)...
A distinguishing characteristic of these sites is how they are moderated:
>
> We designed the Stack Exchange network engine to be mostly self-regulating, in that we amortize the overall moderation cost of the system across thousands of teeny-tiny slices of effort contributed by regular, everyday users.
>
> -- [A Theory of Moderation](http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/)
>
>
>
While there certainly are [Moderators](https://stackoverflow.blog/2018/11/21/our-theory-of-moderation-re-visited/) here, a significant amount of the *moderation* is done by ordinary people, using the privileges
they've earned by virtue of their contributions to the site. Each of you contributes a little bit of time and effort, and together you accomplish much.
As we enter a new year, let's pause and reflect, taking a moment to appreciate the work that we do here together.
And what could be more festive than a big pile of numbers?
So here is a breakdown of moderation actions performed on The Workplace over the past 12 months:
```
Action Moderators Community¹
----------------------------------------- ---------- ----------
Users suspended² 19 29
Users destroyed³ 9 0
Users deleted 5 0
Users contacted 52 11
Tasks reviewed⁴: Suggested Edit queue 49 4,051
Tasks reviewed⁴: Reopen Vote queue 0 2,623
Tasks reviewed⁴: Low Quality Posts queue 14 1,139
Tasks reviewed⁴: Late Answer queue 0 152
Tasks reviewed⁴: First Post queue 0 4,364
Tasks reviewed⁴: Close Votes queue 4 12,029
Tags merged 10 0
Tag synonyms proposed 1 2
Tag synonyms created 2 3
Revisions redacted 2 1
Questions unprotected 0 2
Questions reopened 10 162
Questions protected 109 227
Questions migrated 8 2
Questions merged 2 0
Questions flagged⁵ 11 3,194
Questions closed 189 1,642
Question flags handled⁵ 791 2,410
Posts unlocked 2 25
Posts undeleted 18 98
Posts locked 16 318
Posts deleted⁶ 237 2,182
Posts bumped 0 10
Escalations to the Community Manager team 8 4
Comments undeleted 142 12
Comments flagged 70 9,712
Comments deleted⁷ 12,938 13,821
Comment flags handled 5,769 4,016
Answers flagged 32 2,032
Answer flags handled 960 1,101
All comments on a post moved to chat 292 115
```
### Footnotes
¹ "Community" here refers both to [the membership of The Workplace](https://workplace.stackexchange.com/users) *without* [diamonds next to their names](https://workplace.stackexchange.com/users?tab=moderators), and to the automated systems otherwise known as [user #-1](https://workplace.stackexchange.com/users/-1).
² The system will suspend users under three circumstances: when a user is recreated after being previously suspended, when a user is recreated after being destroyed for spam or abuse, and when a network-wide suspension is in effect on an account.
³ A "destroyed" user is deleted along with all that they had posted: questions, answers, comments. [Generally used as an expedient way of getting rid of spam.](https://meta.stackexchange.com/questions/88994/what-is-the-difference-between-a-deleted-user-and-a-destroyed-user)
⁴ This counts every review that was submitted (not skipped) - so the 2 suggested edits reviews needed to approve an edit would count as 2, the goal being to indicate the frequency of moderation actions. This also applies to flags, etc.
⁵ Includes close flags (but *not* close or reopen votes).
⁶ This ignores numerous deletions that happen automatically in response to some other action.
⁷ This includes comments deleted by their own authors (which also account for some number of handled comment flags).
### Further reading:
* Wanna see how these numbers have changed over time? I posted a similar report here last year: [2018: a year in moderation](https://workplace.meta.stackexchange.com/questions/5851/2018-a-year-in-moderation)...
* You can also check out [this report on other sites](https://stackexchange.com/search?q=title%3A%222019%3A+a+year+in+moderation%22)
* Or peruse [detailed information on the number of questions closed and reopened across all sites](https://meta.stackexchange.com/questions/341507/2019-a-year-in-closing)
Wishing you all a happy new year... | I think this summary would be incomplete without mentioning the fact that in 2019 our site lost three out of five elected moderators.
---
Further reading for those interested in more details:
* [Update: an agreement with Monica Cellio](https://meta.stackexchange.com/q/340906/165773)
* [Resigning as moderator](https://workplace.meta.stackexchange.com/q/6314/168)
* [Resigning as moderator from Workplace.SE](https://workplace.meta.stackexchange.com/q/6316/168)
* [Firing mods and forced relicensing: is Stack Exchange still interested in cooperating with the community?](https://meta.stackexchange.com/q/333965/165773) |
1,562 | <p>I began college in 2007 and then dropped out in 2009. I returned late 2011 to finish my final year and have completed it just last week. So basically it took me 5 years to do a 3 year degree. It was a degree in software development.</p>
<p>I have just begun looking for a job (entry level) and I am wondering if this will affect my chances and how could I explain it? The reason I dropped out was due to personal circumstances, I was stressed out and wasn't sure if I wanted to continue pursuing a career in software. During those 2 years I was unemployed and I could have returned sooner if I had the money. Should I just be honest and say what I have just said?</p>
<p>To be honest, doesn't this kind of convey that I am flaky and lack integrity? Why I am thinking that is because imagine this was a software project, it is 2 years overdue and that's after changing my mind a few times.</p>
<p>I'm also wondering, should I display my resume like this:</p>
<pre><code>2007-2012 Bachelor of Science, Software Development
</code></pre>
<p>or something like this?</p>
<pre><code>2007-2009, 2011-2012 Bachelor of Science, Software Development
</code></pre>
<p>Thanks!</p>
| [
{
"answer_id": 1564,
"author": "jcmeloni",
"author_id": 26,
"author_profile": "https://workplace.stackexchange.com/users/26",
"pm_score": 6,
"selected": true,
"text": "<p>There's no rule you need to show the start date and end date of your coursework on your resume, so the following is p... | 2012/05/31 | [
"https://workplace.stackexchange.com/questions/1562",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/698/"
] | I began college in 2007 and then dropped out in 2009. I returned late 2011 to finish my final year and have completed it just last week. So basically it took me 5 years to do a 3 year degree. It was a degree in software development.
I have just begun looking for a job (entry level) and I am wondering if this will affect my chances and how could I explain it? The reason I dropped out was due to personal circumstances, I was stressed out and wasn't sure if I wanted to continue pursuing a career in software. During those 2 years I was unemployed and I could have returned sooner if I had the money. Should I just be honest and say what I have just said?
To be honest, doesn't this kind of convey that I am flaky and lack integrity? Why I am thinking that is because imagine this was a software project, it is 2 years overdue and that's after changing my mind a few times.
I'm also wondering, should I display my resume like this:
```
2007-2012 Bachelor of Science, Software Development
```
or something like this?
```
2007-2009, 2011-2012 Bachelor of Science, Software Development
```
Thanks! | There's no rule you need to show the start date and end date of your coursework on your resume, so the following is perfectly fine:
>
> 2012 BS, Software Development, Your School Name
>
>
>
The reasoning behind adding the span of years while in school is to explain time away from working (outside of school) or to show that you're still *in* school -- not to show how long it took you to get your degree. If you were, say, 25 years old and wanted to explain the 7 years after high school and some of that was work and some of that was school, and that time didn't overlap, then sure - go ahead and list it all broken out so that a hiring manager could piece together your timeline -- but it's only the graduation date that matters (and to be perfectly honest, hiring managers aren't going to try to piece together a school and work timeline for an entry-level job unless they have a lot of time on their hands. For instance, I wouldn't bother.)
Since you're looking for entry-level jobs, the baseline expectations are that you are a recent graduate -- it doesn't much matter how long it took you to get there, because people have gaps in education for *all sorts of reasons* -- just taking a break, wanting to gain work experience, needing to pay bills, military service, domestic reasons, and so on.
What matters is that you clearly outline the **skills you can use** starting the day you get hired, either because you learned them in school or you have practical knowledge.
Saying all the things you said would be fine *if you were asked*, because it would be the truth (although I'd be careful not to overshare just like I would be careful not to overshare with any stranger -- it's awkward). *Lying* shows a lack of integrity, not explaining the truth when asked.
Just relax and send your resume around. Don't worry about the past -- there's no reason any of that should haunt you. |
1,604 | <p>Suppose my boss's name is John Smith and in person I address him as "John". Is it better to start the email saying</p>
<pre><code>Hi Mr. Smith
</code></pre>
<p>or simply </p>
<pre><code>Hi John
</code></pre>
<p>I know it's somewhat minor, but I want to avoid being too informal. I appreciate any tips or advice.</p>
| [
{
"answer_id": 1605,
"author": "Daniel Pittman",
"author_id": 256,
"author_profile": "https://workplace.stackexchange.com/users/256",
"pm_score": 4,
"selected": false,
"text": "<p>It depends entirely on your boss. I have no problem when my staff do that, but I have worked for people who... | 2012/06/03 | [
"https://workplace.stackexchange.com/questions/1604",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/761/"
] | Suppose my boss's name is John Smith and in person I address him as "John". Is it better to start the email saying
```
Hi Mr. Smith
```
or simply
```
Hi John
```
I know it's somewhat minor, but I want to avoid being too informal. I appreciate any tips or advice. | As you use "John" in person I'd go with that in the e-mail.
The only exception I consider making is if the e-mail is a formal one - something as serious as resigning or an official complaint - then I'd use "Mr. Smith".
For anything else - holiday requests etc. stick with the less formal greeting. |
2,381 | <p>I've been asked to manage a team working on a project with which I am only marginally familiar. Getting more familiar with the project (desired outcome, expected timeline, etc) won't be a problem, but the technical work the team members are doing is outside my area of expertise. I've never done the kind of work they are doing on this project, or worked with the technologies in question (although I do have some experience in similar areas). </p>
<p>I know they are all capable in this area, and I'm confident in my abilities to manage a team where I'm familiar with the technical work and have been in the positions of the team members before, but I'm not sure how that will translate to leading a crew where I don't fully understand all of the technical details.</p>
<p>(How) can I effectively lead the team if I don't fully understand the technical details of the project?</p>
| [
{
"answer_id": 2382,
"author": "Oded",
"author_id": 1513,
"author_profile": "https://workplace.stackexchange.com/users/1513",
"pm_score": 2,
"selected": false,
"text": "<p>When managing a technical team you certainly do not have to be fluent in the technology - you need to manage the pro... | 2012/07/09 | [
"https://workplace.stackexchange.com/questions/2381",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/869/"
] | I've been asked to manage a team working on a project with which I am only marginally familiar. Getting more familiar with the project (desired outcome, expected timeline, etc) won't be a problem, but the technical work the team members are doing is outside my area of expertise. I've never done the kind of work they are doing on this project, or worked with the technologies in question (although I do have some experience in similar areas).
I know they are all capable in this area, and I'm confident in my abilities to manage a team where I'm familiar with the technical work and have been in the positions of the team members before, but I'm not sure how that will translate to leading a crew where I don't fully understand all of the technical details.
(How) can I effectively lead the team if I don't fully understand the technical details of the project? | Well the good news is that you trust the capabilites of the people working on the project. That makes it significantly easier. You know project management, so you know how to keep them on track as far as budget and deadlines, etc. When they want to do something you don't understand, ask questions. You want to feel more up to speed on the subject, so make sure you aren't questioning their judgement but rather trying to educate yourself.
Where the biggest problem comes in is when you need to make a choice when two (or more) of these people disagree about what to do. In this case, I recommend that you have them do a formal decision analysis where each rates what they want to do against the criteria that you determine (hours to develop, performance, etc.) Then once you have those ratings, go take a quick look around the Internet to see if they are relatively correct. Once you have a rating for each choice for each possible criteria (and you determine the relative importance of the criteria based on project needs) then it is usually easily to see which is the better choice. Have them bring their analysis to a meeting and discuss so each side has a chance to shoot holes in the other's argument. But make them keep it civil.
```
Weighting Plan A Plan B
Criteria factor Score Total Score Total
Performance 4 3 12 4 16
Maintainability 3 3 9 4 12
Development Speed 3 2 6 2 6
Security 5 5 25 1 5
Total 52 39
```
After you know the people better, you will have a feel for who is usually right, then you may give some extra credence to what that person wants to do, but remember, no one is right all the time and automatically picking George's solution over Simon's every time will make Simon resentful. So truly listen to both and choose based on the criteria you give them. |
2,915 | <p>I was reading <a href="http://www.joelonsoftware.com/items/2006/08/09.html">The Econ 101 Management Method by Joel Spolsky</a>. He speaks of management tactics to motivate developers by paying them for fewer bugs (for instance). He describes how bad such approach can be, and what drawbacks it has. </p>
<p>I was wondering if this conclusion extends on the cases when the management is ready to pay a little bit more for some "special" tasks. For example, a developer creates a big and complicated piece of an application, and gets more money for it. </p>
<p>Isn't it better to raise the developer's salary since he/she is qualified and experienced enough to handle such a complicated task? Or to have task-money policy? Has any manager/team leader had such an experience?</p>
| [
{
"answer_id": 2916,
"author": "Community",
"author_id": -1,
"author_profile": "https://workplace.stackexchange.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>For a lot of people, building software has intrinsic value. That intrinsic motivation is more powerful than any fi... | 2012/07/30 | [
"https://workplace.stackexchange.com/questions/2915",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/2197/"
] | I was reading [The Econ 101 Management Method by Joel Spolsky](http://www.joelonsoftware.com/items/2006/08/09.html). He speaks of management tactics to motivate developers by paying them for fewer bugs (for instance). He describes how bad such approach can be, and what drawbacks it has.
I was wondering if this conclusion extends on the cases when the management is ready to pay a little bit more for some "special" tasks. For example, a developer creates a big and complicated piece of an application, and gets more money for it.
Isn't it better to raise the developer's salary since he/she is qualified and experienced enough to handle such a complicated task? Or to have task-money policy? Has any manager/team leader had such an experience? | ```
raise the developer's salary since he/she is qualified and experienced enough
to handle such a complicated task?
```
It would suggest to "Pay a very good market rate or above to the talented developers. Otherwise, they are smart enough to consider other options and switch companies."
```
have a policy where one can ask for money?
```
That is dangerous and bad policy for a full-time employee, however, it might be very reasonable for contractors
Some points in regard to software developer's compensation:
* Pay a good market rate or above it to a good developer. Otherwise,
they may consider switching companies.
* Terminate contracts with developers who always delay or who have caused problems with a deliverable. After a third big mistake would be a good guideline.
* Allocate enough resources to avoid employees burning out, and have a realistic manager to manage the team of developers. |
5,672 | <p>I joined up at a place a few months ago as a web developer. They hired me thinking I was "green" to the industry, placing me as a junior developer, and giving me menial tasks at first. </p>
<p>I've since proven to them that I am competent and have been handed off more difficult tasks, but often they are tasks that involve working with someone else's code.</p>
<p>The developer that is considered my senior has coded multiple things I've worked with, and they have done nearly everything wrong. The code I am forced to utilize on tight deadlines is typically unacceptable, and the code itself lends the inference that the other developer is just skirting by and really has no idea what they are doing with the language. For this reason, it has become almost "nagging" of me to continually ask them why they did something. I feel obligated to fix it for the client, but it would exponentially increase the time I need to spend on projects. I have been avoiding that, but it is becoming unavoidable. </p>
<p>I need a way to approach the PM as well as this developer to kindly inform them that what the developer did was improper and it will require additional hours on my behalf to fix the mistakes. However, even just typing that out I feel like a jerk.</p>
<p>An HTML example I came across recently is by laying out an unordered list of links like so </p>
<pre><code><ul><li>item1</li></ul> <ul><li>item2</li></ul>
</code></pre>
<p>How does one tell someone else that they're "doing it wrong"? </p>
| [
{
"answer_id": 5673,
"author": "Oded",
"author_id": 1513,
"author_profile": "https://workplace.stackexchange.com/users/1513",
"pm_score": 3,
"selected": false,
"text": "<p>Unfortunately we don't have details and when you say \"they have done nearly everything wrong\" all I can take away ... | 2012/10/18 | [
"https://workplace.stackexchange.com/questions/5672",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/1344/"
] | I joined up at a place a few months ago as a web developer. They hired me thinking I was "green" to the industry, placing me as a junior developer, and giving me menial tasks at first.
I've since proven to them that I am competent and have been handed off more difficult tasks, but often they are tasks that involve working with someone else's code.
The developer that is considered my senior has coded multiple things I've worked with, and they have done nearly everything wrong. The code I am forced to utilize on tight deadlines is typically unacceptable, and the code itself lends the inference that the other developer is just skirting by and really has no idea what they are doing with the language. For this reason, it has become almost "nagging" of me to continually ask them why they did something. I feel obligated to fix it for the client, but it would exponentially increase the time I need to spend on projects. I have been avoiding that, but it is becoming unavoidable.
I need a way to approach the PM as well as this developer to kindly inform them that what the developer did was improper and it will require additional hours on my behalf to fix the mistakes. However, even just typing that out I feel like a jerk.
An HTML example I came across recently is by laying out an unordered list of links like so
```
<ul><li>item1</li></ul> <ul><li>item2</li></ul>
```
How does one tell someone else that they're "doing it wrong"? | A few thoughts.
**Dealing with ugly code**
>
> The code I am forced to utilize on tight deadlines is typically unacceptable
>
>
>
Assuming you're working in The Real World, this is inevitable. It is not feasible to expect every employee to write every piece of code in an "acceptable" fashion. You *will* run into ugly code and most of the time you'll just have to work with it. This is the ugly truth of the computing industry; clients don't see how pretty the code is, clients see when it ships and whether or not it works. So my first piece of advice would be **choose your battles wisely**. It is probably not reasonable for you to expect to clean up every piece of bad code you are forced to work with. So make careful judgments about how much time it would take to fix a thing, how hard it would be to just deal with it, etc. **Be decisive**. Decide *for sure* whether or not you want to raise issue or just let it pass, and then act accordingly. Indecision is a drag and can become a huge detriment to your productivity, so eliminate it. It's OK to decide to postpone the decision, but get in the attitude of *"I make decisions; I'm in control."*
**Being a jerk**
>
> I need a way to approach the PM as well as this developer to kindly inform them that what the developer did was improper and it will require additional hours on my behalf to fix the mistakes. However, even just typing that out I feel like a jerk.
>
>
>
You shouldn't feel like a jerk. There is nothing wrong with identifying and wanting to fix a problem, and certainly nothing wrong with being honest about how you feel. You cannot control what others think of you; walking on eggshells and keeping your insights to yourself will only place more of a burden on you. People make mistakes, yourself included. In my opinion, the best way to reconcile this sort of situation is to **confront it**, and clearly explain *why* you think it's wrong. However, while you do this, **be open to correction**. There may be some things you've overlooked. More importantly, this demonstrates that you are sincerely interested in the quality of the product, and not interested in just being Holier Than Thou. There is a delicate balance here; if you are too weak presenting your beliefs about the problem, you will just get bulldozed. If you are too strong presenting your beliefs, you will be perceived as arrogant. Make your arguments with evidence, refer to unambiguous policy and best practices, and don't act like there's solidity in your argument if you don't have such things to back it up. If you're as smart as you think you are, then people will quickly learn to appreciate your criticism, because it is correct, and leads to easier programming and a better product. Even if you're not quite as smart as you think you are, you will either *still* help others identify mistakes they otherwise would have missed (and people appreciate that), or the others will help correct *your* mistake (which you should appreciate).
**Climbing the ladder**
>
> They hired me thinking I was "green" to the industry, placing me as a junior developer, and giving me menial tasks at first. I've since proven to them that I am competent and have been handed off more difficult tasks. ... The developer that is considered my senior has coded multiple things I've worked with, and they have done nearly everything wrong.
>
>
>
Again, the best solution is to talk with your boss about these concerns. If you think you deserve a promotion -- or even just more respect -- then ask for it! If you think a certain employee needs to be educated then discuss the situation with your boss, with his boss, or with him directly. Be honest. Be open to correction. You don't have to be completely satisfied with the outcome of the conversation, but you do need to have that conversation or else thinking about it will slowly eat away at you.
**Ms Frizzle's advice**
Nobody expects you to be perfect, and nobody expects you to consider them to be perfect. So go out there, **take chances, make mistakes, get messy!** |
6,571 | <p>Some of my time in school was also spent working on a website which led to various freelance projects, earned me jobs and speaker opportunities at conferences, built up a portfolio, published a book, and yes, made some money. It also covers some time I spent in-between degrees, which is why I started listing it on my resume (to avoid getting questions about any "gaps", and besides, LinkedIn doesn't seem to like people only having a few jobs to start). </p>
<p>I'd been advised in the past that listing this time on my resume -- specifically, listing myself as the "Owner" -- was a no-no because it made me look less agreeable and employable because I'd never "worked under" anyone at this point, not to mention it made me look like a "flight risk". </p>
<p>This advice was given to me a few years ago, so I've been listing this time as work as an "Illustrator / Writer" instead... although I'm starting to wonder the wisdom of this, especially as it was just one lady saying it, even if the lady saying so was an "expert" brought in as a guest speaker for the class one time. Plus, I now have time I spent at a company working with other people at this point, so some of her concerns are less valid than they used to be.</p>
<p>Is it really so bad to dub myself an Owner, and if so, what SHOULD I call my position and/or emphasize about the work I did (and still doing)?</p>
| [
{
"answer_id": 6574,
"author": "David Segonds",
"author_id": 5128,
"author_profile": "https://workplace.stackexchange.com/users/5128",
"pm_score": 1,
"selected": false,
"text": "<p>I think that the way you describe this part of your professional experience highly depends on the type of j... | 2012/11/28 | [
"https://workplace.stackexchange.com/questions/6571",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5086/"
] | Some of my time in school was also spent working on a website which led to various freelance projects, earned me jobs and speaker opportunities at conferences, built up a portfolio, published a book, and yes, made some money. It also covers some time I spent in-between degrees, which is why I started listing it on my resume (to avoid getting questions about any "gaps", and besides, LinkedIn doesn't seem to like people only having a few jobs to start).
I'd been advised in the past that listing this time on my resume -- specifically, listing myself as the "Owner" -- was a no-no because it made me look less agreeable and employable because I'd never "worked under" anyone at this point, not to mention it made me look like a "flight risk".
This advice was given to me a few years ago, so I've been listing this time as work as an "Illustrator / Writer" instead... although I'm starting to wonder the wisdom of this, especially as it was just one lady saying it, even if the lady saying so was an "expert" brought in as a guest speaker for the class one time. Plus, I now have time I spent at a company working with other people at this point, so some of her concerns are less valid than they used to be.
Is it really so bad to dub myself an Owner, and if so, what SHOULD I call my position and/or emphasize about the work I did (and still doing)? | If you did not actually own a company (a legal entity and all that it entails) and were for all intents and purposes self-employed as a freelancer, then I agree wholeheartedly that the advice you were once given that listing "owner" is inappropriate.
As a hiring manager, if I see "owner" I expect to be interviewing someone with at least moderate skills in business, resource, and personnel management -- and not just your own books and your own time. Listing "owner" when you can't particularly show those skills would be a no-no to me -- if you couldn't walk in the door to a small business and run it, don't make it look like you could (and that's what "owner" or "president" or whatever says to me).
Now, if I see "freelance writer/illustrator" on a resume, it's very clear to me what you did -- especially if you bullet-point the things you said, e.g.:
```
Freelance writer/illustrator, date start to date end (or "present")
- description of types of jobs you completed
- list your published work
- other important qualities or skills performed
```
then that is far more beneficial and true to me than "owner" would be.
As to how to "avoid getting questions about any gaps", if your freelance work spanned several years, even if it was off and on, just put the whole range. The nature of freelance work is that it *can* be off and on; that's expected. For example, on my own resume (here's what it looks like on [LinkedIn](http://www.linkedin.com/pub/julie-meloni/40/837/1ba/), if that helps), I have a period of time from 1995 to 1998 where I was freelancing and working whatever contracts I wanted to pick up, for whatever length of time. I've always just listed it like the example above. Sometimes I point out what company I worked for, if it was more impressive than not, but over time that matters less.
Basically, just be honest. If you didn't "own" something, don't say you did. If you did a variety of good work over a period of time, say so. Use the cover letter or phone screen or interview to put the pieces together if someone finds it particularly unclear. |
7,575 | <p>I’m relatively early on in my career, and as such have worked for two companies. A very approximate example of what roles I’ve had is:</p>
<ul>
<li>2010-2013 Apple Company B</li>
<li>2009-2010 Senior Banana Company A </li>
<li>2008-2009 Banana Company A</li>
<li>2007-2008 Junior Banana Company A</li>
</ul>
<p>And I currently on my CV only show 2 roles, namely of Apple (2010-2013) and Senior Banana (2007-2010) as I originally felt that showing four roles might get too cluttered.
The questions around this I have are</p>
<ol>
<li><p>If I put a job title and length of service, will prospective employers assume I have done that role for the whole period? And if so should I make it clear that I wasn’t always a Senior Banana in Company A?</p></li>
<li><p>If I put in specific promotions, will this devalue the current title? My concern around putting all roles in is that if I switch industry / sector it might make the seniority of the last title seem less important.</p></li>
</ol>
<p>I found <a href="https://workplace.stackexchange.com/questions/3051/how-do-i-represent-career-progression-within-a-single-company-on-a-cv?rq=1">this</a> related question, but felt this didn’t extent to address the scope of my specific questions.</p>
<p><strong>Edit to include more detail:</strong></p>
<p>Each level of Banana had different responsibilities - i.e. Junior Banana was help with XXX, Banana was be primary / lead contact for XXX, Senior was run / get new clients for XXX. Promotion for each title is kind of expected on an annual basis within the industry.</p>
<p>I'm actually interested in being an Orange, and as such that industry might not know how a banana's career progression would typically change. </p>
<p>I'm unsure if this is relevant, but contemporaries / friends I know who also worked as a Junior / Senior Banana have grouped all three titles into one as I have tended to in the past - could this be an industry specific trend? [I am aware this this may not be answerable!]</p>
| [
{
"answer_id": 7576,
"author": "Oded",
"author_id": 1513,
"author_profile": "https://workplace.stackexchange.com/users/1513",
"pm_score": 5,
"selected": true,
"text": "<blockquote>\n <p>If I put a job title and length of service, will prospective employers assume I have done that role f... | 2013/01/08 | [
"https://workplace.stackexchange.com/questions/7575",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/3165/"
] | I’m relatively early on in my career, and as such have worked for two companies. A very approximate example of what roles I’ve had is:
* 2010-2013 Apple Company B
* 2009-2010 Senior Banana Company A
* 2008-2009 Banana Company A
* 2007-2008 Junior Banana Company A
And I currently on my CV only show 2 roles, namely of Apple (2010-2013) and Senior Banana (2007-2010) as I originally felt that showing four roles might get too cluttered.
The questions around this I have are
1. If I put a job title and length of service, will prospective employers assume I have done that role for the whole period? And if so should I make it clear that I wasn’t always a Senior Banana in Company A?
2. If I put in specific promotions, will this devalue the current title? My concern around putting all roles in is that if I switch industry / sector it might make the seniority of the last title seem less important.
I found [this](https://workplace.stackexchange.com/questions/3051/how-do-i-represent-career-progression-within-a-single-company-on-a-cv?rq=1) related question, but felt this didn’t extent to address the scope of my specific questions.
**Edit to include more detail:**
Each level of Banana had different responsibilities - i.e. Junior Banana was help with XXX, Banana was be primary / lead contact for XXX, Senior was run / get new clients for XXX. Promotion for each title is kind of expected on an annual basis within the industry.
I'm actually interested in being an Orange, and as such that industry might not know how a banana's career progression would typically change.
I'm unsure if this is relevant, but contemporaries / friends I know who also worked as a Junior / Senior Banana have grouped all three titles into one as I have tended to in the past - could this be an industry specific trend? [I am aware this this may not be answerable!] | >
> If I put a job title and length of service, will prospective employers assume I have done that role for the whole period?
>
>
>
Yes, they will. A role against a period would indicate that you have done that role throughout the period.
>
> And if so should I make it clear that I wasn’t always a Senior Banana in Company A?
>
>
>
Yes, you should. The thing to do is split the period into the different roles and how long you were doing each.
>
> If I put in specific promotions, will this devalue the current title?
>
>
>
No, of course not. The opposite is true - you got promoted within the company, that shows that you have what it takes, that others valued you enough to promote you (and probably over others in the same position).
In fact, this is something to **highlight**.
```
2010-2013 Apple Company B
details of role and responsibilities
2009-2010 Promoted to Senior Banana - Company A
details of role and responsibilities
2008-2009 Promoted to Banana - Company A
details of role and responsibilities
2007-2008 Junior Banana - Company A
details of role and responsibilities
```
Alternatively:
```
Company B - 2010-2013:
-----------------------
2010-2013 Apple
details of role and responsibilities
Company A - 2007-2010:
----------------------
2009-2010 Promoted to Senior Banana
details of role and responsibilities
2008-2009 Promoted to Banana
details of role and responsibilities
2007-2008 Junior Banana
details of role and responsibilities
``` |
7,601 | <p>I want to restructure my resume so that the first page displays a hierarchical tree of qualifications. My goal is to advertise myself like a tradesman who lists what he can do on the side of his van rather than using a list of employers in the descending chronological order and then the potential customer (AKA employer) has to fish out your credentials by scanning each employer listed. I also think that this approach puts me and my skills in the foreground, rather than who I worked for in the foreground, and it lets me be evaluated by what I did instead of who I worked for.</p>
<p>I still plan to list the employers, but give a much briefer description of each job, as I would like to put less emphasis on that than on my actual skills that I'm bringing to the table.</p>
<p>Considering that I am breaking the convention but also considering that I want to weed out conservative employers who do not appreciate doing things innovatively, is this a good idea? If not, can you suggest a compromise, but something in a format which differs from traditional resumes? My aspiration is to market myself as a contractor who comes in, does the job, and leaves, and as such, I want to differentiate myself from the get-go, i.e. the first kick on the door.</p>
<pre><code>Languages
|
|--Java
| |
| |--Web
| | |
| | |--JSP/JSF
| |
| |--App Server
| | |
| | |--GlassFish
| | |--WebLogic
| |
| |--Framework
| |
| |--Spring
| |--Jersey (JAXB-RS)
| |--Hadoop/MapReduce
|
|--Perl
|
|-- (...)
Data Management
|
|--SQL
| |
| |--Oracle
| |--MySQL
|
|--No SQL
|
|--MongoDB
|--Redis
(...)
</code></pre>
| [
{
"answer_id": 7602,
"author": "pdr",
"author_id": 759,
"author_profile": "https://workplace.stackexchange.com/users/759",
"pm_score": 4,
"selected": false,
"text": "<p>Put yourself in the shoes of the recruiter. When you're looking at 50 resumes, do you want them to look roughly similar... | 2013/01/08 | [
"https://workplace.stackexchange.com/questions/7601",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/3298/"
] | I want to restructure my resume so that the first page displays a hierarchical tree of qualifications. My goal is to advertise myself like a tradesman who lists what he can do on the side of his van rather than using a list of employers in the descending chronological order and then the potential customer (AKA employer) has to fish out your credentials by scanning each employer listed. I also think that this approach puts me and my skills in the foreground, rather than who I worked for in the foreground, and it lets me be evaluated by what I did instead of who I worked for.
I still plan to list the employers, but give a much briefer description of each job, as I would like to put less emphasis on that than on my actual skills that I'm bringing to the table.
Considering that I am breaking the convention but also considering that I want to weed out conservative employers who do not appreciate doing things innovatively, is this a good idea? If not, can you suggest a compromise, but something in a format which differs from traditional resumes? My aspiration is to market myself as a contractor who comes in, does the job, and leaves, and as such, I want to differentiate myself from the get-go, i.e. the first kick on the door.
```
Languages
|
|--Java
| |
| |--Web
| | |
| | |--JSP/JSF
| |
| |--App Server
| | |
| | |--GlassFish
| | |--WebLogic
| |
| |--Framework
| |
| |--Spring
| |--Jersey (JAXB-RS)
| |--Hadoop/MapReduce
|
|--Perl
|
|-- (...)
Data Management
|
|--SQL
| |
| |--Oracle
| |--MySQL
|
|--No SQL
|
|--MongoDB
|--Redis
(...)
``` | Put yourself in the shoes of the recruiter. When you're looking at 50 resumes, do you want them to look roughly similar, so you can compare them? Or do you want to translate the message that the candidate is trying to put across?
Also, do you want a list of skills or a list of achievements (visibly close to the job role in which those achievements were achieved)?
Do you think that you are more likely to hire a contractor who bucks conventions and does everything his own way, or one who impresses but sticks within a standard that everyone has agreed to for a long time? That's not conservative, it's common sense. You may have to hire a different contractor to work on that product later.
I like a bit of innovation, when I'm looking at a candidate, but not overthrowing all conventions. I really wouldn't advise this approach. Not only is it unconventional, it doesn't convey a message I want to read. It just tells me that you've worked with lots of technologies, not that you're any good at any of them and certainly not that you know how to deliver a working product.
Neither, for that matter, does it convey the message that you are "a contractor who comes in, does the job, and leaves." If you want to convey that message then a list of short contracts, each leading to a successful delivery, would be much more effective, no? |
8,750 | <p>In the company I work for we extensively use a knowledge base for technical matters. Everybody can ask questions and everybody can answer.</p>
<p>Of course, there are always contributions that one thinks could be improved. For example, sometimes people misspell words or use lexical constructs that other members of the team do not like. </p>
<p>So a problem has arisen: instead of sending comments to the original author of the contribution, people just edit the contribution to fit their personal preferences.</p>
<p>That has caused a heavy atmosphere in the workplace, because people feel - I don't know the exact word - disrespected when they make a contribution and then some other member of the team puts words in their mouths by editing their post. Edit history is not displayed.</p>
<p>I know edits are made with the best of intentions but I think the right way to proceed is to suggest a change, instead of editing a contribution directly, and leave the final decision to the original author.</p>
<p><strong>How can I ask politely and professionally for editors to stop editing, so as to avoid hurting the authors' feelings?</strong></p>
<hr>
<p>As requested by jcmeloni in the comments below here are the rules of the knowledge-base:</p>
<ol>
<li>Anyone can have an account. The account has a name (not necessarily their real name) and a picture.</li>
<li>Anyone can open a "thread" that can be responded to by other members of the community</li>
<li>Anyone can respond to "threads" or even to responses. </li>
<li>Thread and replies have "contributions" which show who is the original author.</li>
</ol>
<p>Example:</p>
<pre>
Thread: How do I connect to a MySQL database? - kogoro1122 (picture of kogoro1122)
Reply: do x, and y and z, then pray. - Satoshi44 (picture of Satishi44)
</pre>
<p>The problem arises when some other user thinks that satoshi's joke about praying is not tasteful, unprofessional or otherwise does not fit his standard and then proceeds to edit satoshi's response, removing "then pray".</p>
<p>Satoshi then comes to me and asks, "Why man"?</p>
| [
{
"answer_id": 8752,
"author": "HLGEM",
"author_id": 93,
"author_profile": "https://workplace.stackexchange.com/users/93",
"pm_score": 5,
"selected": false,
"text": "<p>You don't. You shouldn't feel insulted any more than you should feel insulted if someone changes your code. You don't o... | 2013/01/11 | [
"https://workplace.stackexchange.com/questions/8750",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5945/"
] | In the company I work for we extensively use a knowledge base for technical matters. Everybody can ask questions and everybody can answer.
Of course, there are always contributions that one thinks could be improved. For example, sometimes people misspell words or use lexical constructs that other members of the team do not like.
So a problem has arisen: instead of sending comments to the original author of the contribution, people just edit the contribution to fit their personal preferences.
That has caused a heavy atmosphere in the workplace, because people feel - I don't know the exact word - disrespected when they make a contribution and then some other member of the team puts words in their mouths by editing their post. Edit history is not displayed.
I know edits are made with the best of intentions but I think the right way to proceed is to suggest a change, instead of editing a contribution directly, and leave the final decision to the original author.
**How can I ask politely and professionally for editors to stop editing, so as to avoid hurting the authors' feelings?**
---
As requested by jcmeloni in the comments below here are the rules of the knowledge-base:
1. Anyone can have an account. The account has a name (not necessarily their real name) and a picture.
2. Anyone can open a "thread" that can be responded to by other members of the community
3. Anyone can respond to "threads" or even to responses.
4. Thread and replies have "contributions" which show who is the original author.
Example:
```
Thread: How do I connect to a MySQL database? - kogoro1122 (picture of kogoro1122)
Reply: do x, and y and z, then pray. - Satoshi44 (picture of Satishi44)
```
The problem arises when some other user thinks that satoshi's joke about praying is not tasteful, unprofessional or otherwise does not fit his standard and then proceeds to edit satoshi's response, removing "then pray".
Satoshi then comes to me and asks, "Why man"? | **The point of maintaining a knowledge base is to spread knowledge,** not to "avoid hurting other people's feelings". Asking how to prevent edits in the name of peace and harmony is asking the wrong question entirely.
Do you think wikipedia would last long if nobody was allowed to make edits just because "it might hurt someone's feelings"? How about if you were part of a plumbing company -- if you botched a job that was leaking all over the place and flooding a room, should your coworkers politely inform you that you needed to fix the leak, or should they just fix the leak when they see it (and prevent further costs in water damage)?
Believe it or not, your coworkers are displaying the right behavior -- rather than let typos and incorrect information persist just because their coworkers are lazy / don't understand the reason for the change, they're fixing it on the spot.
You don't need people to stop editing -- **you need to create an atmosphere that encourages collective ownership** and discourages "personal ownership" of a given topic or post. Make it clear the posts are a company resource and anyone can (and should!) edit the posts to make them the best they can be.
If the entire company takes ownership for the content in the knowledgebase, then individual workers will stop taking edits to the content personally. This is the only way to ensure the content -- i.e. *the purpose of the knowledgebase in the first place* -- is the highest quality it can be. |
9,219 | <pre><code>Technical Expertise:
Languages C, C++
Frameworks Qt
Compilers GCC
Debuggers GDB, Valgrind
Tools Qt Creator, Qt Designer,
OS Linux (OpenSUSE 11.4)
Version Control SVN
</code></pre>
<p>In this example list of the Resume does it make sense to include "Known Concepts" filed too as follows</p>
<p>Example: </p>
<pre><code>Concepts: UML, Design patterns, Unit testing, Makefiles, Socket programming, Data structures
</code></pre>
<p>I am asking this because the person may not have actually <strong>officially</strong> worked on these topics, but he may still know the heads and tails of them!</p>
<p>So, until the interviewer is told about these skills how is he supposed to know?</p>
| [
{
"answer_id": 9220,
"author": "Pukku",
"author_id": 7475,
"author_profile": "https://workplace.stackexchange.com/users/7475",
"pm_score": 3,
"selected": false,
"text": "<p>I would say that yes, it does make sense. Quite often the concepts are more important than the individual languages... | 2013/01/28 | [
"https://workplace.stackexchange.com/questions/9219",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/826/"
] | ```
Technical Expertise:
Languages C, C++
Frameworks Qt
Compilers GCC
Debuggers GDB, Valgrind
Tools Qt Creator, Qt Designer,
OS Linux (OpenSUSE 11.4)
Version Control SVN
```
In this example list of the Resume does it make sense to include "Known Concepts" filed too as follows
Example:
```
Concepts: UML, Design patterns, Unit testing, Makefiles, Socket programming, Data structures
```
I am asking this because the person may not have actually **officially** worked on these topics, but he may still know the heads and tails of them!
So, until the interviewer is told about these skills how is he supposed to know? | Absolutely include concepts here - as Pukku said - being knowledgeable and skilled in a concept can outweigh a specific technology and it is good subject matter for interview questions. Not only that, but it's good hit-word fodder for automatic resume crawlers.
As a thought - for placement and highlighting, there's a lot of rows in the sample resume, filled with very few items - Languages, Frameworks, Compilers, Debuggers, Tools and OS - all of which have 1-2 items. That seems like a lot of resume real estate for not a lot of information. I'd find a way to condense this. Knowing a bit about software, for example, I'd offer the questions:
* the tools related to the Qt framework, are these the standard for how to develop products with Qt, is there a very very high chance that if you know the Qt framework you are working with these tools? If so, then remove the row about tools.
* IMO (open to debate) - a "cc" type compiler for C/C++ is par for the course - certainly not everyone has specifically used "gcc", but most have used something similar. If the candidate is an absolute *whiz* with gcc and can address all sorts of C-to-machine-code issues that are unique to the compiler, then say something like "gcc Expert" - if not, skip it.
* OS - keep it, but be cautious about being overly specific. If you've used OpenSUSE 11.4, I'd expect you'd be perfectly qualified for 11.5 or even 12, and probably wouldn't have a problem with 9 or 10, either. And I'm going to bet that you'll be OK on almost any flavor of Linux - so telling me OpenSUSE 11.4 makes it feel very specific, and I'm not sure you want that.
Most managers are smart enough to realize things like that - that a person who's worked on gcc won't have a problem with another similar compiler, that a "Linux guy" is pretty good on almost any Linux/Unix product (but will probably complain bitterly about Windows!), and that someone who's worked in Qt probably can handle analogous frameworks and products - but realize that driving down into tight detail here just isn't so valuable.
I'd go with shooting for 3 rows of technology/list of details pairs, unless you are so far along in your career that your massive breadth of technical knowledge is a cornerstone of your skill set. I'd aim for something more like:
```
Technical Expertise:
Languages & Frameworks: C, C++, Qt
Development tools: GCC, GDB, Valgrind, SVN
OS: Linux (OpenSUSE)
Concepts:: UML, Design patterns, Socket programming, Data structures
```
I killed off Makefiles and Unit Testing. Makefiles because they are a standard part of how you use a C/C++ compiler, so I'd think if you were to claim you knew how to compile in GCC, you'd be claiming you knew how to build or edit makefiles. And Unit Testing because it's a standard part of many software development lifecycles and what I consider the basics for being a software developer - so too basic to be a standout on a resume. Data structures is a bit problematic as well - but I wasn't sure at what level we are talking about. If it's simply knowing the data structures that come up in a programming 101 class (array, list, tree, etc) and the various typical optimal uses for them and how to barebones create them and manipulate data within them, then skip it. If it's a deeper working knowledge of them and perhaps coupling that knowledge with Design Patterns, then include it.
Realize that often there's a story to be told on a resume. If the candidate, for example, didn't just do unit testing, and makefiles but in a personal project found an awesome and fascinating way of using the two together to bootstrap his own automated unit test suite that was initiated on every compilation using a sophisticated set of makefiles -- well, wohoo!, let's talk about it - but what matters here is not the raw skill, but the project - put it in as a personal project in the experience section with a single sentence on the cool part of this work using the relevant key words.
This is where it comes down to wanting to fit as many good things about the candidate as possible onto a page, while making sure you make the resume easy enough for a manager to read. The stuff you call out at the top can't just be a raw list for the sake of completeness, it should give the interviewer enough of a sense of the strengths of the candidate that the two can have a productive conversation. |
9,247 | <blockquote>
<p><strong>Technical Expertise:</strong></p>
</blockquote>
<pre><code>Languages & Frameworks: C, C++, Qt
Development tools: GCC, GDB, Valgrind, SVN
OS: Linux (OpenSUSE)
Concepts:: UML, Design patterns, Socket programming, Data structures
</code></pre>
<p>This is a sample from my example resume.</p>
<p>I <strong><em>know</em></strong> these subjects but I cannot say that I am an <strong><em>expert</em></strong> in these subjects. I do not want to mislead the interviewer by the fancy words like "Technical Expertise". </p>
<p>I want him to question me but not like as if I am a God or a super man!<br>
<strong>What heading should be written instead of "Technical Expertise" when I am not an "expert"?</strong> </p>
| [
{
"answer_id": 9248,
"author": "JB King",
"author_id": 233,
"author_profile": "https://workplace.stackexchange.com/users/233",
"pm_score": 5,
"selected": true,
"text": "<p>Experience would be the most obvious choice. This way all you are implying is that you have used these technologies... | 2013/01/29 | [
"https://workplace.stackexchange.com/questions/9247",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/826/"
] | >
> **Technical Expertise:**
>
>
>
```
Languages & Frameworks: C, C++, Qt
Development tools: GCC, GDB, Valgrind, SVN
OS: Linux (OpenSUSE)
Concepts:: UML, Design patterns, Socket programming, Data structures
```
This is a sample from my example resume.
I ***know*** these subjects but I cannot say that I am an ***expert*** in these subjects. I do not want to mislead the interviewer by the fancy words like "Technical Expertise".
I want him to question me but not like as if I am a God or a super man!
**What heading should be written instead of "Technical Expertise" when I am not an "expert"?** | Experience would be the most obvious choice. This way all you are implying is that you have used these technologies and could have varying levels of skill.
Skill would also work as you are identifying specific areas though this doesn't always work as some software may not be seen as a skill.
Proficiencies would be a more formalized term if you wanted something a bit more exotic than experience. |
9,425 | <p>I have a very broad IT skillset and I would say that I am very good at what I do. When it comes to a technology that I have not used I just learn it by messing with it, Googling it, or by consulting the documentation. I've been looking at DICE lately and the requirements are very specific:</p>
<pre><code> "X years working with VMWare"
"Y years working as a senior Windows Administrator supporting Exchange"
"Z years working with INSERT_BRAND_NAME NAS technologies"
</code></pre>
<p>Formally for the past few years I've worked as a Linux admin, mostly in the web sector. I have touched Windows a few times (adding users\fixing GP\installing software) at my jobs however I am mostly a Linux admin.</p>
<p>I have been using Windows for 10+ years. I have recovered from all kinds of corruption and nastiness. I know how to set up AD. I have set up mock environments with replication. Windows is very "point and click". Most Linux concepts about things such as DNS apply to Windows.</p>
<p>Same goes with virtualization. I have not touched VMWare day in and day out specifically for Y years however I have worked with other software in the web sector. I know about partitioning resources. I use VMWare at home and can spin up a VM with my eyes closed. ESXi is very good software as well. It is all point and click and can be learned in an hour. If you don't know something, Google does.</p>
<p>I feel however as the HR powers that be are rejecting my resume because I don't have things like documented Windows experience. All they know is the requirements say "Y years Windows experience" and this guy has few Windows "projects" so trash. </p>
<p>I want to do something else other than Linux but I feel pigeonholed by my resume. How can I deal with this?</p>
| [
{
"answer_id": 9619,
"author": "David Manpearl",
"author_id": 7724,
"author_profile": "https://workplace.stackexchange.com/users/7724",
"pm_score": 1,
"selected": false,
"text": "<p>In order to list a year of experience, it does not necessarily have to be a solid year of full-time deep-d... | 2013/02/05 | [
"https://workplace.stackexchange.com/questions/9425",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/7593/"
] | I have a very broad IT skillset and I would say that I am very good at what I do. When it comes to a technology that I have not used I just learn it by messing with it, Googling it, or by consulting the documentation. I've been looking at DICE lately and the requirements are very specific:
```
"X years working with VMWare"
"Y years working as a senior Windows Administrator supporting Exchange"
"Z years working with INSERT_BRAND_NAME NAS technologies"
```
Formally for the past few years I've worked as a Linux admin, mostly in the web sector. I have touched Windows a few times (adding users\fixing GP\installing software) at my jobs however I am mostly a Linux admin.
I have been using Windows for 10+ years. I have recovered from all kinds of corruption and nastiness. I know how to set up AD. I have set up mock environments with replication. Windows is very "point and click". Most Linux concepts about things such as DNS apply to Windows.
Same goes with virtualization. I have not touched VMWare day in and day out specifically for Y years however I have worked with other software in the web sector. I know about partitioning resources. I use VMWare at home and can spin up a VM with my eyes closed. ESXi is very good software as well. It is all point and click and can be learned in an hour. If you don't know something, Google does.
I feel however as the HR powers that be are rejecting my resume because I don't have things like documented Windows experience. All they know is the requirements say "Y years Windows experience" and this guy has few Windows "projects" so trash.
I want to do something else other than Linux but I feel pigeonholed by my resume. How can I deal with this? | Job requirements as used for resume screening are always going to be imperfect. There have been some popular questions here on this topic, that I recommend reading, such as [How can I overcome "years of experience" requirements when applying to positions?](https://workplace.stackexchange.com/questions/1478/how-can-i-overcome-years-of-experience-requirements-when-applying-to-positions).
However rough of an approximation they provide, though, you are not going to get too far by placing the blame on the recruiter's side. Which means that *you* need to do something about it. I think that anything you can do will fall into one of three areas:
1. **Improve perceptions without lying (improve your resume)**.
2. **Improve your skills**.
3. **Adjust your expectations**.
Improve perceptions
-------------------
There are an enormous amount of resources on this very site, as well as across the web, about how to tailor a resume to a specific skill set. Instead of writing as who you *have been*, rewrite it with a focus **on the skills that have prepared you for who you want to be**.
Remember; integrity is of high importance in the job search process. Make sure you can back up what you say. It may not be "as good" as you wish it was, but that is where parts **#2** and **#3** come in.
Improve your skills
-------------------
There may be limited accomplishments you can achieve on your own due to the nature of the skill you are looking to add, but I'm sure there are several concrete things you can do. Here are a few ideas.
* Get Microsoft certified
* Run your own Windows Server, including mail, for personal use.
* Participate in MS/Windows/Exchange help forums until you are good enough to be giving the answers. **This will teach you what you do not know, which may be key to #3**.
Adjust your expectations
------------------------
First the good news. I think you will find from reading around here and other places that "X years working **with** [technology]" does not mean that you need to use it day-in and day-out. This number should be completely justifiable by your experience (my own opinion, but I'm not an ops recruiter).
But here's the finer detail: The second bullet point does not use the word *with*, and it's not about a technology. It is a job title and it uses the word **as**. Sometimes, a company wants someone who's done ***that*** job before and there's no way around it. You may be out of luck unless you have an MS skill list a mile long. **I suspect it's much more difficult to get around the "Y years work *as* [job title]**. This is an objective filter that they want or they wouldn't have listed it.
Why? Have you heard of the [Dunning-Kruger effect](http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect)? It is an effect of individuals with less skill tend to perceive themselves at a much higher level than they really are. In any deep skill set, there are levels and levels of details that define what expertise in that skill really is. Individuals without years of experience *acting as a problem-solver in that role* cannot perceive these layers of difficulty.
See also:
* <http://en.wikipedia.org/wiki/Four_stages_of_competence>
* <http://explorativeapproach.com/fools-plight-the-dunning-kruger-effect/>
The latter link also includes this fantastic chart illustrating this effect:

Don't take this too harshly; it sounds like you have great skills in *related areas* and enough skill to certainly get you started in a new area, maybe to do do so without a significant learning curve. But, with that said, here are a couple statements you said that may hinder your progress, by keeping you from seeing what you still can learn:
* *Most Linux concepts about things such as DNS apply to Windows.*
* *Windows is very "point and click".*
* *It is all point and click and can be learned in an hour.*
Most likely you have the skills to burn through these things and get up to speed quickly. However, don't discount the layers of complexity that you haven't even been exposed to yet.
Summary
-------
Here's the most important point. **If you want to change tracks, expect to take a couple steps back.** Don't let your expertise in one field to fool you into thinking you are already an expert in another; instead, let it **inform** your learning in the new area and give you a head start.
You're more likely to succeed if you avoid arrogance. Realize what you have yet to learn, and while you tweak your perceived ability to recruiters, start acquiring the skill you need to really impress in the interview room. |
9,659 | <p>Our company is an IT service provider which develops software for other companies. To attract customers, we encourage our employees to complete and maintain IT certifications (like Java certificates from Oracle, for example) so we can promote our highly qualified employees in our marketing.</p>
<p>The exam itself and the preparation material is paid for by the company, so employees do not need to shoulder any expenses. I was asked by my boss if I have any ideas on how to motivate our employees to complete certificates? There are several problems we are facing:</p>
<ul>
<li>If an employee is not in a project currently, he has "free time" so he can study during work time for a certificate. However, some employees are in projects and would have to study during off work hours.</li>
<li>Certificates, depending on the topic and the personal experience, can take a long time to learn. E.g. I needed 60 hours, but for other certificates where I have no experience in it could take longer. This question is not about certificates where you study for a few days and then can pass the exam.</li>
<li>We thought about a financial bonus, the suggestion was $500, but honestly, I won't spent 60 hours or more in my free time to get $500.</li>
<li>I also suggested a pay raise, but the problem is that this likely could be seen as "you only get a pay raise if you complete certificates", which demotivates employees even more.</li>
</ul>
<p>So the biggest problem is to motivate employees which would have to study for certificates in their off work hours because they are on projects. How can this be achieved?</p>
| [
{
"answer_id": 9660,
"author": "gnat",
"author_id": 168,
"author_profile": "https://workplace.stackexchange.com/users/168",
"pm_score": 8,
"selected": true,
"text": "<blockquote>\n <p>motivate employees... to make certificates in their free time because they are on projects</p>\n</block... | 2013/02/13 | [
"https://workplace.stackexchange.com/questions/9659",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/7752/"
] | Our company is an IT service provider which develops software for other companies. To attract customers, we encourage our employees to complete and maintain IT certifications (like Java certificates from Oracle, for example) so we can promote our highly qualified employees in our marketing.
The exam itself and the preparation material is paid for by the company, so employees do not need to shoulder any expenses. I was asked by my boss if I have any ideas on how to motivate our employees to complete certificates? There are several problems we are facing:
* If an employee is not in a project currently, he has "free time" so he can study during work time for a certificate. However, some employees are in projects and would have to study during off work hours.
* Certificates, depending on the topic and the personal experience, can take a long time to learn. E.g. I needed 60 hours, but for other certificates where I have no experience in it could take longer. This question is not about certificates where you study for a few days and then can pass the exam.
* We thought about a financial bonus, the suggestion was $500, but honestly, I won't spent 60 hours or more in my free time to get $500.
* I also suggested a pay raise, but the problem is that this likely could be seen as "you only get a pay raise if you complete certificates", which demotivates employees even more.
So the biggest problem is to motivate employees which would have to study for certificates in their off work hours because they are on projects. How can this be achieved? | >
> motivate employees... to make certificates in their free time because they are on projects
>
>
>
Above is a huge red flag, don't do this.
If it's *really* in company interests ("so we can say we have highly qualified employees"), don't cheat about personal improvement. What serves the company, should be done in **work hours**, don't invade into employees private life for that. Keep in mind that forcing employees to work over the reasonable hours (and preparing to certifications *is* work) can lead to productivity losses, as explained eg in [Why We Have to Go Back to a 40-Hour Work Week to Keep Our Sanity](http://www.alternet.org/story/154518/why_we_have_to_go_back_to_a_40-hour_work_week_to_keep_our_sanity):
>
> ...for most of the 20th century, the broad consensus among American business leaders was that working people more than 40 hours a week was stupid, wasteful, dangerous, and expensive — and the most telling sign of dangerously incompetent management to boot. ...every hour you work over 40 hours a week is making you less effective and productive over both the short and the long haul. And it may sound weird, but it’s true: the single easiest, fastest thing your company can do to boost its output and profits -- starting right now, today -- is to get everybody off the 55-hour-a-week treadmill, and back onto a 40-hour footing.
>
>
>
If it's *really* in company interests, drop that reasoning like "some employees are in projects". What you need instead is a management 101: prioritize the value of employee being in a project versus that of studying and plan / allocate **work hours** accordingly.
* Allocating **work hours** for employee training and certification is a perfectly normal and widely spread practice, there is no need to deviate from it. For example, I specifically re-checked certifications currently listed in my LinkedIn profile: there are 11 of these that were performed in work hours, suggested / required and paid by companies (this has been at all companies I used to work at) - in other words, those that didn't require *artificial self-motivation* on my side (for the sake of completeness, the list also contains 5 certifications that I took at my own will, in my free time etc).
---
Generally, one better be careful about incentives to *free hours* activities. Just imagine...
```
- [company] We will pay $1000 if you pass OCJCMC-AC/DC
certification in your free time.
- [employee] Wow great I'll go for it!
--- 2-3 months later... ---
- [company] We'll cut your bonus by $2000 because you failed project X.
- [employee] Oh but... but I was in bad shape because I spent
much effort preparing for certification.
- [company] Oops.
- [employee] WTF?!
```
This can kill any motivation faster than you say "Oops". |
10,367 | <p>To cut a long story short, my company is set up like this:</p>
<pre><code>51% is mine, the programmer
39% is my wife's, the artist
10% is my father's, who helped set up the company
</code></pre>
<p>However, my wife has only been a burden lately. As far as our relationship goes, I am extremely passive and she is very much the alpha personality. I'm fine with that but she is using that to try and force decisions to be made.</p>
<p>For instance, our first project has been live for several years. It is very much in need of a "version 2.0" remake, but my wife is insistent on just rewriting the code without changing any of the appearance (which in my opinion is extremely outdated)</p>
<p>It should also be noted that she hasn't worked in about ayear. I really need to remove her from the company and take over, but I have no idea how to go about it.</p>
<p>How can I effectively remove my wife from the company without causing significant problems?</p>
| [
{
"answer_id": 10368,
"author": "nadyne",
"author_id": 7293,
"author_profile": "https://workplace.stackexchange.com/users/7293",
"pm_score": 3,
"selected": false,
"text": "<p>Wow, not just \"a family member\", but your wife. That makes it at least twice as difficult, if not moreso. </p... | 2013/03/19 | [
"https://workplace.stackexchange.com/questions/10367",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/8271/"
] | To cut a long story short, my company is set up like this:
```
51% is mine, the programmer
39% is my wife's, the artist
10% is my father's, who helped set up the company
```
However, my wife has only been a burden lately. As far as our relationship goes, I am extremely passive and she is very much the alpha personality. I'm fine with that but she is using that to try and force decisions to be made.
For instance, our first project has been live for several years. It is very much in need of a "version 2.0" remake, but my wife is insistent on just rewriting the code without changing any of the appearance (which in my opinion is extremely outdated)
It should also be noted that she hasn't worked in about ayear. I really need to remove her from the company and take over, but I have no idea how to go about it.
How can I effectively remove my wife from the company without causing significant problems? | I am married to my business partner, and we both work in the company all the time. We each own one share of the company and there is no third share. We have no shareholders' agreement: the lawyer who helped us incorporate said "if you ever need a shareholders' agreeement you'll have much bigger problems and the agreement won't help you." We formed the company in 1986 and incorporated (and got that advice) in 1989. Still married, still running the business together. Over the years there have been times when one of us carried more weight than the other for various reasons, but it's always come back to a happy and productive balance. Also over time we've changed who does what or which of our skills we use according to what the company needs or what else is going on in our lives.
The only way you get out of this still married and a relatively happy couple is if you work together as a couple to make a decision, whether it's to replace her in the business, to get her working in the business again, or to release version 2 with the old look and continue with not really having an artist in the company.
With or without a mediator or therapist, you need to understand what has been going on for the last year. That you can describe her behaviour as "not working" and think you can solve it by firing her surprises me a lot. Maybe she's depressed. Maybe she's been busy with something you didn't mention, like a newborn baby or a dying parent. But if she's just on the couch eating bonbons saying "the interface is fine, you go and redo the code" then firing her (presumably so you can hire a replacement) is not going to go well. First and foremost you must understand why she is doing what she is doing.
Once you understand it, the next step is "what do you want"? Why do you need to fire her to get a new look? What if you brought in some "help" for her - someone to do the new look? Are you more concerned that someone with a 40% share in the company isn't doing any work? Would you be paying her anyway, perhaps for tax reasons? Or paying you more without her salary, with the same total family income either way? Would you be happy if the look stayed the same but she started working - on code, on marketing, on paperwork - or do you just really really want the look changed?
Once you know what you want (including whether or not you want to stay married) and why she stopped working, then there is a chance that the two of you can move forward together with a plan you both like and get to a happier place. But you deciding to fire her as step 1 is surely not that plan. |
10,405 | <p>I am trying to cut out all the unnecessary decorations on my resume and make it as minimalist as possible to give more weight to the skills and experience. One of the considered line items within that initiative was to knock out the months from the employment ranges and leave only years. </p>
<p>E.g. before</p>
<pre><code>Company X
Mar 2008-Nov 2011
</code></pre>
<p>Now becomes</p>
<pre><code>Company X
2008-2011
</code></pre>
<p>I wonder if this is a good idea.</p>
<p><strong>OUTCOME:</strong> As a result of many good rationales in favor of keeping the months, I have decided to do so. Thanks to all responders.</p>
| [
{
"answer_id": 10406,
"author": "Neil T.",
"author_id": 5016,
"author_profile": "https://workplace.stackexchange.com/users/5016",
"pm_score": 5,
"selected": true,
"text": "<p>As a hiring manager, I would probably ask you to supply the months, so I could get a better understanding of your... | 2013/03/20 | [
"https://workplace.stackexchange.com/questions/10405",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/3298/"
] | I am trying to cut out all the unnecessary decorations on my resume and make it as minimalist as possible to give more weight to the skills and experience. One of the considered line items within that initiative was to knock out the months from the employment ranges and leave only years.
E.g. before
```
Company X
Mar 2008-Nov 2011
```
Now becomes
```
Company X
2008-2011
```
I wonder if this is a good idea.
**OUTCOME:** As a result of many good rationales in favor of keeping the months, I have decided to do so. Thanks to all responders. | As a hiring manager, I would probably ask you to supply the months, so I could get a better understanding of your work history. I'd want to know and be able to ask you about any extended periods between employment. My rules of thumb tend to lean toward:
* One job ending in the same or subsequent month the next job begins means you likely left of your own volition.
* Two to five months difference may signify the job loss was not your choice, but you had the initiative and/or the talent to be able to find another job relatively quickly.
* Six months or longer will definitely cause me to ask you to explain the gap.
If there is education or skill development that covers all or part of the time period, I could readily assume you were focusing on your studies, which may or may not leave you sufficient time and focus for a quality job search.
All that being said, you may come across a hiring manager that isn't looking as closely as I would to these types of details. Whether or not you include or exclude the months is completely up to you. Historically, I've never excluded them personally, and I don't recall ever hiring someone that didn't include the information. With that in mind, I would never reject an applicant who didn't supply the information, and I know I've never summarily rejected an applicant who didn't provide the months if their work experience met the qualifications I was looking for. I guess what I'm trying to say is if you really feel the need to trim down content, be more concise with your job duties. |
10,411 | <p>Consider following seating arrangements:</p>
<p>A)</p>
<p><img src="https://i.stack.imgur.com/SnBBP.png" alt="A"></p>
<p>B)</p>
<p><img src="https://i.stack.imgur.com/ysbCe.png" alt="B"></p>
<p>C)</p>
<p><img src="https://i.stack.imgur.com/oIF5m.png" alt="C"></p>
<pre><code>**Key:**
Red Circle: Person
Brown Rectangle: Table
Blue Line: Window
Black Protrusion: Door
</code></pre>
<p>For example, in the last office I worked we sit like in A. I liked it because it felt like you are working together as a team. Now I sit in a B office and it feels weird every time someone enters the door because I can not see who is entering the room. Also it feels strange not to see what others are doing or if they are looking at you.</p>
<p>Do seating arrangements affect the working performance of the employees? I.e. are there any studies about it? I would like to know if my current feeling is just something I will get used to or if they are eliglible and we would profit of changing the seating arrangements.</p>
| [
{
"answer_id": 10412,
"author": "Michael",
"author_id": 5005,
"author_profile": "https://workplace.stackexchange.com/users/5005",
"pm_score": 0,
"selected": false,
"text": "<p>Excellent question, there has been discussion of this before in academia but my general feelings are:</p>\n\n<ol... | 2013/03/20 | [
"https://workplace.stackexchange.com/questions/10411",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/7752/"
] | Consider following seating arrangements:
A)

B)

C)

```
**Key:**
Red Circle: Person
Brown Rectangle: Table
Blue Line: Window
Black Protrusion: Door
```
For example, in the last office I worked we sit like in A. I liked it because it felt like you are working together as a team. Now I sit in a B office and it feels weird every time someone enters the door because I can not see who is entering the room. Also it feels strange not to see what others are doing or if they are looking at you.
Do seating arrangements affect the working performance of the employees? I.e. are there any studies about it? I would like to know if my current feeling is just something I will get used to or if they are eliglible and we would profit of changing the seating arrangements. | Given how limitless the combinations of seating arrangements can be, I'm sure there are studies out there. There are certainly a number of theories proposed regarding the seating of knowledge workers, and my opinion is you have to pick and choose from your favorite theories based on the nature of the team, the nature of the work, and other factors in the environment.
Here's some of the theories I've seen most:
* **Open seating** - proposed largely by agile software development practices, and high-interaction models of work - fits most closely with your Option A. The main idea being that you seat people in a way that will optimize for communication - staring at each other helps you figure out more easily that the other folks in the room need to (or are) communicating and in an environment where the team is the key ingredient, this is the favorite choice.
* **Context switch minimization** - you'll see it a lot in the writings of Joel Spoelsky, and many others - the proposed perfection is something like offices for everyone, with doors that close and distration minimization efforts. The idea being that once an engineer hits a state of "flow", where he's uploaded all the key ingredients to solving the problem/creating the new thing - that he needs a minimum of distraction to keep that state of mind intact for as long as possible. That fits with your option B to a certain extent, particularly in a case where you can't have offices.
My reality-check based on a few too many management books
---------------------------------------------------------
**1 - Mixing and matching rarely works**
You can't have a high interation/low context switch scenario. While they aren't mutually exclusive, necessarily, there is no perfect seating arrangement that does both perfectly. Once you arrange people so they are tuned in (option A), you will end up increasing context switches - some are good (hey, you're struggling... what's wrong? can I help?)... some are inane (what the heck was that face? Oh... my coffee is cold, I'm going to go heat it up... hey - great game on TV last night, huh?).
My first gut reaction as a middle manager is if that if you gave me option C, I'd say "what's the point?" - are you mixing and matching for the sake of it? I'd only propose this if there was some particular reason why two people (at the top of th picture) have a particular reason to stare at each other more than the other two. For some completely physical reason (the walls on that part of the room have no power outlets...)
**2 - Space trumps all**
Due to the cost and complexity of office rooms, you'll rarely see a corporate environment that doesn't include a factor of this. Where the power outlets are, where the heating/cooling blows, and how many people we have to pack in this space will trump idealistic team communication stuff every time. So, when you walk into a room and think "what on earth where they thinking?", figure that there's probably a physical aspect of the environment worth asking about.
**3 - Equality and Rank are important**
All of your systems seem to assume a reasonably similar rank of person. For example, there is no manager office, or need for any other specialized job function.
More subtle are things like access to windows... sometimes people love it, and crave it, other times, they avoid it. It's important to be aware of the tone set with stuff like premiere space - people can get really jumpy about it.
**4 - No matter what you do, someone will find a way to hate it.**
The corallary being - "do what you can and then let it go" - someone always wants something else. There's never a perfect case. If you set "everyone is happy" as your goal, you are bound to fail. My preferred goal is "most people can live with it, a few are happy about it, and it doesn't impede getting work done".
Also - with any new environment, there's a 1-2 month bake in time where people will be unhappy simply because change = bad.
**5 - Corporate culture is an influencer**
That doesn't mean that you need to avoid bucking the system. But realize that it's a factor. For example:
* same old, same old - for this company will get less complaining, and an assumption of "that's how it is" conveyed to new people.
* new and different - will usually wake people up to the fact that the world has change and something new is in the mix. This is a great thing for cases where you want a new process and for people to realize that it's more than just a fresh coat of paint over business as usual.
**Putting the right people together matters more than the configuration**
By this I mean - if your configuration is such that people are annoying the heck out of each other, or good people are getting left out unintentionally - then you have a bigger problem than anything a perfect theory will help you fix.
Where your managers go, where your great partners at doing awesome things, where your problem children go... it all factors in. It's amazing what can impact people. |
10,587 | <p>About 2 months ago I was asked to make a charity website for a friend, it was only going to be a html/css website ie. No need for PHP, JavaScript etc, being a friend I offered £60 for the website, we decided the look of the website and I created the graphics etc, the website was done.</p>
<p>Recently he asked me to completely change the look of the website (no problem), ie remodelling and new graphics but now with what he wanted it required PHP, user access, JavaScript, ajax, DOM manipulation, the lot pretty much as he wanted an application form (over 30 fields), a donation payment form, a lot more pages than before, and I'm still under the impression he thinks he only needs to pay £60. What can I say, politely to tell him it's really not enough for the work I'm doing?</p>
| [
{
"answer_id": 10589,
"author": "MDMoore313",
"author_id": 5936,
"author_profile": "https://workplace.stackexchange.com/users/5936",
"pm_score": 4,
"selected": true,
"text": "<p>I agree with Oded, it sounds like an entirely new website. Consider the following services with regards to web... | 2013/03/25 | [
"https://workplace.stackexchange.com/questions/10587",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/8410/"
] | About 2 months ago I was asked to make a charity website for a friend, it was only going to be a html/css website ie. No need for PHP, JavaScript etc, being a friend I offered £60 for the website, we decided the look of the website and I created the graphics etc, the website was done.
Recently he asked me to completely change the look of the website (no problem), ie remodelling and new graphics but now with what he wanted it required PHP, user access, JavaScript, ajax, DOM manipulation, the lot pretty much as he wanted an application form (over 30 fields), a donation payment form, a lot more pages than before, and I'm still under the impression he thinks he only needs to pay £60. What can I say, politely to tell him it's really not enough for the work I'm doing? | I agree with Oded, it sounds like an entirely new website. Consider the following services with regards to websites:
```
Adds
Moves
Changes
```
Of course alot of us learn by experience in the freelance field, but if he wants to change *the entire look of the website*, then that is by definition a new site, even if it's still `myfriendswebsite.com`. It may take some convincing and examples of what would fall under the Adds Moves & Changes categories and what would not, but ultimately it's up to the customer to continue to do business with you or not.
With my own website clients, I inform them that the template we agree on is it. If they want to `Add` a page, that's fine, `Move` content on a page then great, or `Change` a page or the content of a page then okay, as long as we still have the same basic template. |
11,232 | <p>Although my progress at my current company is good, due to some personal issues with my manager, I am planning to move to another company. I am feeling uncomfortable working with him. However, I am not sure what should I tell about the following questions to the HR of the new company. </p>
<pre><code>1. Why do you want to leave your current company?
</code></pre>
<p>I don't want to bad mouth about my manager as he is good interms of providing interesting projects. However, as I said before, we have some differences. Therefore, I would like to tell the following as an answer for this question: "Although the projects are interesting at my current work, I am looking for new challenges and opportunity to grow. I believe that your company will offer me to grow." </p>
<pre><code>2. Can you provide a reference letter from your current manager?
</code></pre>
<p>I am not sure whether I can get a good recommendation letter from my current manager or not. Therefore, I would like to say no. But I am not sure what is the best way to say no. </p>
<p>Please help me.</p>
<p>Thanks.</p>
| [
{
"answer_id": 11234,
"author": "pdr",
"author_id": 759,
"author_profile": "https://workplace.stackexchange.com/users/759",
"pm_score": 2,
"selected": false,
"text": "<p>Ok, given that it's about an individual, but purely professional, I think you need to be honest but positive about it.... | 2013/04/20 | [
"https://workplace.stackexchange.com/questions/11232",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/8521/"
] | Although my progress at my current company is good, due to some personal issues with my manager, I am planning to move to another company. I am feeling uncomfortable working with him. However, I am not sure what should I tell about the following questions to the HR of the new company.
```
1. Why do you want to leave your current company?
```
I don't want to bad mouth about my manager as he is good interms of providing interesting projects. However, as I said before, we have some differences. Therefore, I would like to tell the following as an answer for this question: "Although the projects are interesting at my current work, I am looking for new challenges and opportunity to grow. I believe that your company will offer me to grow."
```
2. Can you provide a reference letter from your current manager?
```
I am not sure whether I can get a good recommendation letter from my current manager or not. Therefore, I would like to say no. But I am not sure what is the best way to say no.
Please help me.
Thanks. | My recommendation is to leave the negativity behind you and start fresh at a new job. Your reason for leaving your current job needs to include something that says what you're bringing the new job, for example:
>
> "Although the projects are interesting at my current work, I am looking for new challenges and opportunity to grow. I believe I can achieve that growth and make a positive contribution by joining your organization."
>
>
>
It will also look good if you do some research on that company and their industry prior to your interview.
In regards to a letter of recommendation, I would just answer "no" with no further explanation. Employers are not kindly benefactors looking out for your well-being, after all. By leaving their company, you're taking your training, experience and productivity out the door with you, causing them to have to go through the time and expense to replace you. Why should they reward you with a recommendation letter? Here in the US, former employers are required to provide the date range that you worked for them, period. |
11,551 | <p>During interviews for engineering / technical positions I am always asked the question:</p>
<pre><code>Regarding your experience with ____, how would you rate yourself on a scale of 1 to 10?
</code></pre>
<p>I find this very hard to quantify with programming languages because the more you do know the more you realize how little you know. </p>
<ol>
<li>Is there any sort of standard system to figure out where one might rate on this scale?</li>
<li>If you're unsure is it better to go higher or lower during interviews?</li>
</ol>
| [
{
"answer_id": 11552,
"author": "Chris Pitman",
"author_id": 604,
"author_profile": "https://workplace.stackexchange.com/users/604",
"pm_score": 3,
"selected": false,
"text": "<p>This question is almost completewly impossible to accurately answer, shown particularly by the <a href=\"http... | 2013/05/03 | [
"https://workplace.stackexchange.com/questions/11551",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/1842/"
] | During interviews for engineering / technical positions I am always asked the question:
```
Regarding your experience with ____, how would you rate yourself on a scale of 1 to 10?
```
I find this very hard to quantify with programming languages because the more you do know the more you realize how little you know.
1. Is there any sort of standard system to figure out where one might rate on this scale?
2. If you're unsure is it better to go higher or lower during interviews? | Given how the answer *seems* straightforward, but is really dependant on your own perspective, I'd say clarify your perspective in the answer... something like:
>
> I find that the more you know, the more you know what you need to learn. Generally I'd rate a "10" as ((*insert how you define ultimate knowledge*)), and "1" as ((*your own words on very basic knowledge*)). In my opinion, you need at least a ?3? to be trusted to code in a language reasonably successfully with peer reviews only for complex issues and high-stakes verification, and at an ?8? you can help most other people... in X language I rate myself an N and here's why..."
>
>
>
Yes, very wordy, but it gives them a great sense of how you see the world. I'm a big fan of being able to clarify where I expect to fit in the team, because team work is such a big part of me and my career. You may see it differently, and want to give a different example of how you rate skills in comparison to how you contribute on the job... but showing the employer that you have a reasonable grasp of how your skills fit with the job function is a real win here.
**Standards:**
I don't think there's really a standard, since demonstrations of behavior are a factor of both domain knowledge and other skills... for example, a great teacher with a solid knowledge of the basics may be a much better teacher than a vast expert who can't string two explanatory sentences together. In general, my personal rating system is:
1. I picked up a book and tried a simple project or two.
2. I can do basic things, and use a few of the special features.
3. I can use the language well enough to the do the right thing a decent amount of time. I can debug. I'm not always elegant, but at least I get the basic gist. NOTE: for some types of languages, this can be enough. In others that rely on complexity, this can be downright dangerous.
4. I do better than that.
5. Middle of the road - I've been working in the language enough to do the right thing most of the time. No one will read my code and think "WHAT IS THAT???".
6. Better than that.
7. Has a good working knowledge of some of the real nuances and special features of the language. Not only syntax but why is one approach better than another for a complex situation.
8. Has become the go to guy. For hard debugging, for tricky/risky designs - this is the guy who can get you on the right track in a sentence or two cause he just gets it.
9. Better than that.
10. Can write the next book on it. If he's not blogging, lecturing or otherwise talking on the topic, it's because he doesn't like that part of being an expert.
**Risks in Rating**
Generally, be cautious with the extremes. If you have slathered this technology all over your resume, you better be around a 5 or better. If you have it on there at all, figure you need at least a 3.
If you rate yourself at a 8 or better, you're advocating a really high skill set. Absolutely great if you have the skills/knowledge to back it up - but prepare for a good solid quiz or deep dive with a fellow expert. Dangerous ground in the 9 & 10 range, because if you are wrong and you're really not an expert, you'll come off as dangerously overconfident.
I'm not saying that to warn away from numbers outside of the 3-7 range - if it fits, it fits. But be prepared to justify. |
11,938 | <p>I'm updating my resume, and have realized that many programming skills are very brief and abbreviated.</p>
<p>My old resumes would list them in a bulleted list, however due to all the new technologies I'm adding, this leads to a rather long list of very short items, with a lot of whitespace to the right of the section.</p>
<p>I am wondering if it would be appropriate to list these items in a table instead of a list, or to put them inline in a sentence</p>
<p>For example,</p>
<pre>
* C#
* WPF
* WCF
* VB.Net
* ASP.Net
* HTML
* CSS
* Javascript
* T-SQL
</pre>
<p>versus</p>
<pre>
C# VB.Net HTML
WPF ASP.Net CSS
WCF T-SQL Javascript
</pre>
<p>versus</p>
<pre>
C#, WPF, WCF, VB.Net, ASP.Net, HTML, CSS, Javascript, T-SQL
</pre>
<p>Is one method preferred over others on my resume to make it easier for employers or recruiters to scan through?</p>
| [
{
"answer_id": 11941,
"author": "Onno",
"author_id": 1975,
"author_profile": "https://workplace.stackexchange.com/users/1975",
"pm_score": 6,
"selected": true,
"text": "<p>I'm no hero when it comes to CVs, but there's a lot of .Net tech in that list. I'd list those in one line. That way ... | 2013/05/23 | [
"https://workplace.stackexchange.com/questions/11938",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/316/"
] | I'm updating my resume, and have realized that many programming skills are very brief and abbreviated.
My old resumes would list them in a bulleted list, however due to all the new technologies I'm adding, this leads to a rather long list of very short items, with a lot of whitespace to the right of the section.
I am wondering if it would be appropriate to list these items in a table instead of a list, or to put them inline in a sentence
For example,
```
* C#
* WPF
* WCF
* VB.Net
* ASP.Net
* HTML
* CSS
* Javascript
* T-SQL
```
versus
```
C# VB.Net HTML
WPF ASP.Net CSS
WCF T-SQL Javascript
```
versus
```
C#, WPF, WCF, VB.Net, ASP.Net, HTML, CSS, Javascript, T-SQL
```
Is one method preferred over others on my resume to make it easier for employers or recruiters to scan through? | I'm no hero when it comes to CVs, but there's a lot of .Net tech in that list. I'd list those in one line. That way you make most of the space available. You could opt to use some kind of matrix style. I'd still make some kind of distinction between the MS tech and the other techniques.
Something like:
---
.Net technologies and languages:
```
C#, VB.Net, WPF, WCF, ASP.Net. (IIS 7.5?)
```
Web technologies and languages:
```
Javascript, HTML and CSS.
```
I'm familiar with databases.
```
T-SQL. (Maybe MSQL2k8?)
```
---
If the DB stuff is a bit off you could recatagorize the 'web' to 'other'
If you catagorize the line with list of skills to fit some kind of structure, like: "languages, API's, markup languages, software stacks", the structure should be apparent to any human reader. The automated resume scanners just look for strings anyways, so I can't imagine that you'd get slammed by those on how you lay them out on the page.
I don't know how to do the formatting on SE, but you could even have two columns, each with a title and list the techs in a comma separated format like I just presented. That way you can save space without sacrificing structure. |
11,945 | <p>I was reading <a href="http://www.linkedin.com/groups/Does-not-having-address-on-791847.S.181020147" rel="noreferrer">this thread</a> about if an address is really needed on a resume.</p>
<blockquote>
<p><strong>Does not having an address on a resume exclude it from consideration?</strong><br/>
I recently had a difference of opinion about whether job seekers should include their address on their resume. I hold that it is not necessary since most contact is done by phone or email, and not by snail mail. I also think that it has a risk of ending up in the wrong hands. My co-worker disagrees and says that HR professionals want to know whether the applicant is within commuting distance or not. He says that if there isn't an address included, the resume will be immediately discarded.</p>
</blockquote>
<p>which was answered with</p>
<blockquote>
<p>My view is aligned with your position. At least as far as the software industry goes, tons of people are leaving physical address off these days. In fact, many people don't have resumes and instead use online profiles. In software, there is much more demand than available engineers, so if we throw out a resume just because it doesn't have an address, we're shooting ourselves in the foot. It results in fishing in a smaller pond and with more competition.</p>
<p>Throwing the resumes out might be reasonable when doing high-volume recruiting in an industry where available candidates far outstrips demand.</p>
</blockquote>
<p>I happen to also share the opinion that since most contact these days is done by email or phone, the address is not necessary on a resume.</p>
<p>Is this actually the case? Or would excluding my mailing address from my resume be detrimental towards my chances at catching a potential employer's attention?</p>
| [
{
"answer_id": 11947,
"author": "Keith Thompson",
"author_id": 237,
"author_profile": "https://workplace.stackexchange.com/users/237",
"pm_score": 5,
"selected": true,
"text": "<p>I'd say yes. Most contact is going to be by phone or e-mail; a mailing address isn't necessary these days --... | 2013/05/23 | [
"https://workplace.stackexchange.com/questions/11945",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/316/"
] | I was reading [this thread](http://www.linkedin.com/groups/Does-not-having-address-on-791847.S.181020147) about if an address is really needed on a resume.
>
> **Does not having an address on a resume exclude it from consideration?**
>
> I recently had a difference of opinion about whether job seekers should include their address on their resume. I hold that it is not necessary since most contact is done by phone or email, and not by snail mail. I also think that it has a risk of ending up in the wrong hands. My co-worker disagrees and says that HR professionals want to know whether the applicant is within commuting distance or not. He says that if there isn't an address included, the resume will be immediately discarded.
>
>
>
which was answered with
>
> My view is aligned with your position. At least as far as the software industry goes, tons of people are leaving physical address off these days. In fact, many people don't have resumes and instead use online profiles. In software, there is much more demand than available engineers, so if we throw out a resume just because it doesn't have an address, we're shooting ourselves in the foot. It results in fishing in a smaller pond and with more competition.
>
>
> Throwing the resumes out might be reasonable when doing high-volume recruiting in an industry where available candidates far outstrips demand.
>
>
>
I happen to also share the opinion that since most contact these days is done by email or phone, the address is not necessary on a resume.
Is this actually the case? Or would excluding my mailing address from my resume be detrimental towards my chances at catching a potential employer's attention? | I'd say yes. Most contact is going to be by phone or e-mail; a mailing address isn't necessary these days -- and if they want to mail you something, they'll probably have called or e-mailed you first, and can ask for your home address then.
My resume shows my home city and zip code. It gives readers a good idea of where I live without showing my actual address. (This is specific to the US; for other countries, showing a postal code but not a street address should serve the same purpose.)
It looks something like this:
```
MY NAME
=======
My City, ST, 12345
My.Email@example.com
.
.
.
``` |
12,292 | <p>I have written two books about software development and I must admit they have a very fine rating on amazon.</p>
<p>However, I have no idea how I can add them to my current CV to highlight my familiarity and expertise in software development.</p>
<p>Should I add the cover picture and maybe the cover text or would that be too much?</p>
| [
{
"answer_id": 12293,
"author": "Community",
"author_id": -1,
"author_profile": "https://workplace.stackexchange.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>A Cover Picture and the cover text would definitely be too much. You're trying to list your relevant skills not ma... | 2013/06/10 | [
"https://workplace.stackexchange.com/questions/12292",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/7314/"
] | I have written two books about software development and I must admit they have a very fine rating on amazon.
However, I have no idea how I can add them to my current CV to highlight my familiarity and expertise in software development.
Should I add the cover picture and maybe the cover text or would that be too much? | A Cover Picture and the cover text would definitely be too much. You're trying to list your relevant skills not make a sale to them.
In CV's that are specific and rigid, e.g some companies give you a blank template that you must fill in then placing this in the section called 'Other', this would probably be the best place to list them in this kind of format:
```
Written book on 'Genetic Engineering' called "How to breed wrestling plants", published 2004 - ISBN 1337
```
This then shows what its about, what its called and when it was written.
If you received any awards for your books then listing those underneath would be a good idea too to highlight how well received your books were.
--
If you have the freedom to write your CV as you choose then an alternate option is to highlight that you have this experience by having a specific section titled 'Publications' where this relevant information can be listed as above.
This would also aid you in drawing more attention to this experience than putting it in other. |
12,375 | <p><a href="https://workplace.stackexchange.com/a/1852/9489">Another Workplace SE answer</a> describes the situation well in the USA:</p>
<blockquote>
<p>[Many contractors are employed under] W2, [which] means that you're an employee of the contracting agency. They handle the billing and other overhead, pay payroll taxes and usually offer benefits (quality varies by company). They bill the client, usually about 50% or more higher than what you'll see. For example, they bill the client company $80/hr for your time and pay you $45/hr....</p>
<p>In general, you'll see about 20-30% more on an annual basis as a W2 contractor.</p>
</blockquote>
<p>Often these type of W2 contractors will be hired directly by the company they are contracting by after some time. The idea being that that the employee has a trial period and can be easily let go if needed because "hey, they're just a contractor, they don't actually work for us." They company employing the contractors does not pay for health insurance, other benefits, or payroll taxes for the contractor, and pays the contractor more because of this.</p>
<p>When a contractor is hired directly by the company they are actually working for, there is sometimes a pay cut for the employee because now the company is paying for health insurance, other benefits, and payroll taxes for their new employee. (If there is no pay cut you effectively get a raise, "same good salary + new benefits!")</p>
<p>How much should this pay cut be typically?</p>
<p>The above quote suggests 20-30%, but those percentages can be ambiguous.</p>
<p>For example, if I am a contractor, and would normally expect a 70,000$ salary with benefits, I would mark up my salary 30% as a W2 contractor:</p>
<pre><code>70,000 * 1.3 = 91,000
</code></pre>
<p>But come time to be hired, I would not expect a 30% pay cut (at least not calculated in the following way):</p>
<pre><code>91,000 * .70 = 63,700
</code></pre>
<p>That is 10% below my target salary.</p>
<p>I use this example to establish that a salary markup and a salary cut are not equivalent and the way they are calculated varies. Please be aware of this when giving answers.</p>
<p>What is a reasonable pay cut when being hired and offered new benefits?</p>
| [
{
"answer_id": 12377,
"author": "mhoran_psprep",
"author_id": 127,
"author_profile": "https://workplace.stackexchange.com/users/127",
"pm_score": 1,
"selected": false,
"text": "<p>A better rule of thumb in the United States,especially when dealing with government contracting is that the ... | 2013/06/14 | [
"https://workplace.stackexchange.com/questions/12375",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/9489/"
] | [Another Workplace SE answer](https://workplace.stackexchange.com/a/1852/9489) describes the situation well in the USA:
>
> [Many contractors are employed under] W2, [which] means that you're an employee of the contracting agency. They handle the billing and other overhead, pay payroll taxes and usually offer benefits (quality varies by company). They bill the client, usually about 50% or more higher than what you'll see. For example, they bill the client company $80/hr for your time and pay you $45/hr....
>
>
> In general, you'll see about 20-30% more on an annual basis as a W2 contractor.
>
>
>
Often these type of W2 contractors will be hired directly by the company they are contracting by after some time. The idea being that that the employee has a trial period and can be easily let go if needed because "hey, they're just a contractor, they don't actually work for us." They company employing the contractors does not pay for health insurance, other benefits, or payroll taxes for the contractor, and pays the contractor more because of this.
When a contractor is hired directly by the company they are actually working for, there is sometimes a pay cut for the employee because now the company is paying for health insurance, other benefits, and payroll taxes for their new employee. (If there is no pay cut you effectively get a raise, "same good salary + new benefits!")
How much should this pay cut be typically?
The above quote suggests 20-30%, but those percentages can be ambiguous.
For example, if I am a contractor, and would normally expect a 70,000$ salary with benefits, I would mark up my salary 30% as a W2 contractor:
```
70,000 * 1.3 = 91,000
```
But come time to be hired, I would not expect a 30% pay cut (at least not calculated in the following way):
```
91,000 * .70 = 63,700
```
That is 10% below my target salary.
I use this example to establish that a salary markup and a salary cut are not equivalent and the way they are calculated varies. Please be aware of this when giving answers.
What is a reasonable pay cut when being hired and offered new benefits? | I wouldn't accept *any* pay cut, and I'd expect to actually net a bit more. The reason behind this is that the rate the end client is being charged actually factors in your W-2 taxes, and may factor in some benefits (only you know what you've been getting through the agency). Additionally, they are charging enough to make some profit.
Likely, the employer does not specifically know how much of the rate you are being billed at goes to you. They are already paying at least 2x what you get, so if you ask for what you get, that will probably sound delightfully low to them. They pay benefits to all their employees, regardless of salary, and many of those benefits, such as health insurance, won't be calculated as a percentage of your salary.
They're buying a known quantity that has been proven in the work environment, and this naturally has a higher value than someone they're interviewing fresh who might turn out to be a bad fit after they've paid her 5 months at whatever rate she cares to negotiate.
By contrast, I was working 1099 for the company I work for now (W-2), and I *did* take a 30% pay cut to go w-2. |
12,660 | <p>I'm curious about the protocol here. If you are offered a job and supposed to reply by email. When I looked online, I see stuff that looks like formal snail-mail letters, i.e <a href="http://www.whitesmoke.com/how-to-write-a-letter-of-acceptances.html">like this</a>: </p>
<pre><code>Your First Name Your Last Name
Your address
Your phone number
Addressee's First Name Addressee's Last Name
Addressee's title/organization
Addressee's address
Dear Ms. Waters:
I was very happy to receive your phone call this afternoon when you offered me
the position of head 6th grade teacher at the Children's Day School. Please
regard this letter as my formal acceptance.
As we agreed, my starting date will be August 24th, and I will work for the salary
of $36,000 annually plus health coverage according to what we discussed.
Thank you again, Ms. Waters, for providing me with a wonderful opportunity. Please
let me know if there is anything special I should do before my starting date. I am
thrilled to be joining the Children's Day School team.
Sincerely,
Signature
First Name Last Name
Share With Your Friends!
</code></pre>
<p>But does it make sense to put one's name/address at the top of an email? For some reason I would rather just skip the header part, but at the same time I'm not sure of email-protocol. Also, this isn't the "formal" job acceptance exactly( although it is deemed as such).
any tips appreciated, thanks!!</p>
| [
{
"answer_id": 12664,
"author": "Paul Hiemstra",
"author_id": 8240,
"author_profile": "https://workplace.stackexchange.com/users/8240",
"pm_score": 2,
"selected": false,
"text": "<p>I would feel entirely comfortable to just send the body of the mail. For me, adding the formal bits (heade... | 2013/06/27 | [
"https://workplace.stackexchange.com/questions/12660",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/761/"
] | I'm curious about the protocol here. If you are offered a job and supposed to reply by email. When I looked online, I see stuff that looks like formal snail-mail letters, i.e [like this](http://www.whitesmoke.com/how-to-write-a-letter-of-acceptances.html):
```
Your First Name Your Last Name
Your address
Your phone number
Addressee's First Name Addressee's Last Name
Addressee's title/organization
Addressee's address
Dear Ms. Waters:
I was very happy to receive your phone call this afternoon when you offered me
the position of head 6th grade teacher at the Children's Day School. Please
regard this letter as my formal acceptance.
As we agreed, my starting date will be August 24th, and I will work for the salary
of $36,000 annually plus health coverage according to what we discussed.
Thank you again, Ms. Waters, for providing me with a wonderful opportunity. Please
let me know if there is anything special I should do before my starting date. I am
thrilled to be joining the Children's Day School team.
Sincerely,
Signature
First Name Last Name
Share With Your Friends!
```
But does it make sense to put one's name/address at the top of an email? For some reason I would rather just skip the header part, but at the same time I'm not sure of email-protocol. Also, this isn't the "formal" job acceptance exactly( although it is deemed as such).
any tips appreciated, thanks!! | Until you receive a formal offer you can also be informal. But you need to be careful about what you include. Until you see the formal offer you don't want to commit to anything, or quit your old job.
I would just stick to the following format:
>
> Dear Ms. Waters:
>
>
> I was very happy to receive your email regarding the position of head 6th grade teacher at the Children's Day School.
>
>
> I look forward to hearing from you regarding any paperwork and required steps that need to be done prior to joining the company.
>
>
> Thank you again, Ms. Waters, for providing me with a wonderful opportunity.
>
>
> Sincerely,
>
>
> |
12,674 | <p>When systems are down and I cannot do my work so I have a free hour or possibly more, what is an acceptable means of passing time in the office for an engineer?</p>
<p>In the present situation all my work is done from my office to a remote location that I cannot reach due to network issues. I have spoke with my boss and my feedback is to wait.</p>
<p>Things I have considered:</p>
<ul>
<li>Working on my own personal engineering projects that would increase my professional knowledge</li>
<li>Read profession related books or for pleasure (news, fantasy etc.)</li>
<li>Take a coffee break and talk with other co workers in the same situation</li>
<li>Surf the web spending as much time as possible on professional matters</li>
</ul>
<p>My goal here is to stay productive and be a valued member of my company however I don't think I can gain too much from productive ideas waiting for a network to come back up. I hate the idea of 'looking busy' for personal image.</p>
<p>There are <a href="https://workplace.stackexchange.com/q/2644/1842">related questions</a> but this one is specific to system downtime.</p>
| [
{
"answer_id": 12679,
"author": "Caffeinated",
"author_id": 761,
"author_profile": "https://workplace.stackexchange.com/users/761",
"pm_score": 2,
"selected": true,
"text": "<p>Options #1 and #4 are the most reasonable. If you pull out textbooks, I mean.. it just seems <em>too</em> acade... | 2013/06/27 | [
"https://workplace.stackexchange.com/questions/12674",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/1842/"
] | When systems are down and I cannot do my work so I have a free hour or possibly more, what is an acceptable means of passing time in the office for an engineer?
In the present situation all my work is done from my office to a remote location that I cannot reach due to network issues. I have spoke with my boss and my feedback is to wait.
Things I have considered:
* Working on my own personal engineering projects that would increase my professional knowledge
* Read profession related books or for pleasure (news, fantasy etc.)
* Take a coffee break and talk with other co workers in the same situation
* Surf the web spending as much time as possible on professional matters
My goal here is to stay productive and be a valued member of my company however I don't think I can gain too much from productive ideas waiting for a network to come back up. I hate the idea of 'looking busy' for personal image.
There are [related questions](https://workplace.stackexchange.com/q/2644/1842) but this one is specific to system downtime. | Options #1 and #4 are the most reasonable. If you pull out textbooks, I mean.. it just seems *too* academic for an office environ(but maybe i'm wrong).
But yes to:
```
Working on my own personal engineering projects that would increase my professional knowledge
```
and
```
Surf the web spending as much time as possible on professional matters
```
Although "surfing the web" evokes a passive form of engagement, so restrict it(keep it controlled also). Think from the boss' point of view. If you can hone, perfect, improve your current work - that'd be priority #1. Also, lookk into extra-training and etc.
Nice problem to have, i'd say! |
12,676 | <p>My company is going through a transitional period after being bought out by a competitor and we are all being asked to sign a new [non negotiable] contract</p>
<p>Whist in this transitional period my reporting line has changed and my duties have changed as well, I signed a contract to join the company as a support developer where my duties included resolving software bugs by developing fixes for the systems there.</p>
<p>My duties now are to be a go between reporting bugs from the users to the developers and to do no development work at all, I'm basically just filling out forms detailing the issues now rather than offering up fixes. I'm getting quite down about this now as I'm losing touch with my skills and am becoming less marketable </p>
<p>I'm desperate to leave the company but there is a 2 month notice period as part of our contract, if I am made an offer from an employer I will want to move as soon as possible.</p>
<p>Bearing in mind that all I do now are admin tasks that do not use the skill set they employed me for does this mean that the company is in breach of contract? Leaving the current contract I have [not the new ones we have been asked to sign] null and void, so giving me a bit of an angle if I want to leave before I'm contracted to leave?</p>
<p>The new contract has the same notice period in it also so there is no advantage to me signing the new contract.</p>
<p>I'm UK based if that makes any difference, I do understand that the contract is there to protect both my employer and myself.</p>
<p>I am <strong>not</strong> asking for legal advice here, just if my contract is still binding if my job has changed so much that I'm not actually doing the job I was originally employed to do.</p>
| [
{
"answer_id": 12679,
"author": "Caffeinated",
"author_id": 761,
"author_profile": "https://workplace.stackexchange.com/users/761",
"pm_score": 2,
"selected": true,
"text": "<p>Options #1 and #4 are the most reasonable. If you pull out textbooks, I mean.. it just seems <em>too</em> acade... | 2013/06/27 | [
"https://workplace.stackexchange.com/questions/12676",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/5700/"
] | My company is going through a transitional period after being bought out by a competitor and we are all being asked to sign a new [non negotiable] contract
Whist in this transitional period my reporting line has changed and my duties have changed as well, I signed a contract to join the company as a support developer where my duties included resolving software bugs by developing fixes for the systems there.
My duties now are to be a go between reporting bugs from the users to the developers and to do no development work at all, I'm basically just filling out forms detailing the issues now rather than offering up fixes. I'm getting quite down about this now as I'm losing touch with my skills and am becoming less marketable
I'm desperate to leave the company but there is a 2 month notice period as part of our contract, if I am made an offer from an employer I will want to move as soon as possible.
Bearing in mind that all I do now are admin tasks that do not use the skill set they employed me for does this mean that the company is in breach of contract? Leaving the current contract I have [not the new ones we have been asked to sign] null and void, so giving me a bit of an angle if I want to leave before I'm contracted to leave?
The new contract has the same notice period in it also so there is no advantage to me signing the new contract.
I'm UK based if that makes any difference, I do understand that the contract is there to protect both my employer and myself.
I am **not** asking for legal advice here, just if my contract is still binding if my job has changed so much that I'm not actually doing the job I was originally employed to do. | Options #1 and #4 are the most reasonable. If you pull out textbooks, I mean.. it just seems *too* academic for an office environ(but maybe i'm wrong).
But yes to:
```
Working on my own personal engineering projects that would increase my professional knowledge
```
and
```
Surf the web spending as much time as possible on professional matters
```
Although "surfing the web" evokes a passive form of engagement, so restrict it(keep it controlled also). Think from the boss' point of view. If you can hone, perfect, improve your current work - that'd be priority #1. Also, lookk into extra-training and etc.
Nice problem to have, i'd say! |
13,105 | <p>I work at a software company in "Silicon Valley". I am not challenged enough with my current job. I saw a job posting in our career website from the other team that seemed very interesting to me. </p>
<p>Here is structure of my company and where I am and where I want to go:</p>
<pre><code>VP
├── Director1 (Team 1)
│ └── Manager1
│ └── me
└── Director2 (Team 2)
└── Manager2
└── where-i-want-to-go
</code></pre>
<p>Team1 and Team2 are in different location, have different scope of work and using different technologies. I don't know people at team 2.</p>
<p>Who should I approach to? How should I do it without damaging my "royalty" if that didn't work.</p>
| [
{
"answer_id": 13106,
"author": "JB King",
"author_id": 233,
"author_profile": "https://workplace.stackexchange.com/users/233",
"pm_score": 4,
"selected": true,
"text": "<p>First, is there an HR department? They would be where I'd go first to see what is the procedure for doing an inter... | 2013/07/13 | [
"https://workplace.stackexchange.com/questions/13105",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/9094/"
] | I work at a software company in "Silicon Valley". I am not challenged enough with my current job. I saw a job posting in our career website from the other team that seemed very interesting to me.
Here is structure of my company and where I am and where I want to go:
```
VP
├── Director1 (Team 1)
│ └── Manager1
│ └── me
└── Director2 (Team 2)
└── Manager2
└── where-i-want-to-go
```
Team1 and Team2 are in different location, have different scope of work and using different technologies. I don't know people at team 2.
Who should I approach to? How should I do it without damaging my "royalty" if that didn't work. | First, is there an HR department? They would be where I'd go first to see what is the procedure for doing an internal transfer as different companies may have various rules about things.
If there isn't an HR department, then I'd probably approach Manager 2 and ask if there is a way to be internally transferred to fill in the new role. You don't state if the posting was public or just internal to the company, which would be a distinction to my mind. If the latter, I'd just apply and see what happens. On the other hand, a public posting may be better to approach the manager if there isn't HR.
---
There is something to be said for having a prepared answer in a few scenarios here:
1. If the move doesn't work out, does your current team have to know? That would be one point. A second aspect here could be to put it as, "Well, I thought I may be more useful over there but there were better candidates," though one has to be careful to not make this seem like one is accepting a second choice where one is currently working. There are probably better ways to frame this though I'd wonder how public does this knowledge have to be?
2. If the move does work, then the key becomes framing this change as a win/win for the organization and you. In this case it is about moving up in the world in a sense. |
13,527 | <p>I recently joined an organization in which I am to be one of the two new lead developers on the public website. The previous developer (who was alone) left a sizable codebase which although functional, is rigid and fragile. Normally, the saying goes "if it ain't broke don't fix it", but in this case the poor coding style and lack of documentation makes the code unreadable (to me, the other developer, and our interns) and thus require extra time when adding features, tweaking things. Both my partner and I have deemed it essential for both our mental well-being as well as necessary if the development teams are to progress on the organization's schedule.</p>
<p>The problem is that our boss, who is also the head of the organization (biology phD, not a developer) thinks that the last guy was brilliant, and doesn't believe that a rewrite is necessary. Both my partner and I have attempted to <a href="https://workplace.stackexchange.com/questions/9785/is-it-tactful-to-get-in-touch-with-a-previous-developer">contact the previous developer</a>, but to no avail - it appears that he has disappeared off the face of the earth. How do I/we convince the boss the code is in dire need of a major rewrite?</p>
<p>Past Action:</p>
<ul>
<li>We've informed our boss the code is a mess</li>
<li>We've showed him the code (he responds, "what's wrong with it?")</li>
</ul>
<p><strong>EDIT</strong>
I'm am almost completely certain a rewrite is needed. I apologize to all the non-pythonistas out there, but the code looks like this:</p>
<pre><code>def index(request):
return render(request,'index.html',locals())
</code></pre>
<p>repeated for perhaps 20 of the 30 "view" functions in the code. For those of you who don't understand, this type of code essentially requires every member of the team to memorize what is used for each template, and makes it difficult to change the code without breaking anything. From what I could tell, the previous developer had no more than 1 year worth of experience coding, and perhaps none professionally. The code is quite buggy right now, and nobody can quite figure out where/why.</p>
<p>If it changes anything, this is a non-profit research organization so grabbing market share isn't <em>that</em> important, but since members generally stay for about a year or so (while doing their post-doc work) I think readability/ease of maintenance is probably the single largest thing we need (other than functionality).</p>
| [
{
"answer_id": 13529,
"author": "m-oliv",
"author_id": 10102,
"author_profile": "https://workplace.stackexchange.com/users/10102",
"pm_score": 0,
"selected": false,
"text": "<p>I experienced the same difficulty with my current boss. However, I sat with him and explained him why I thought... | 2013/07/31 | [
"https://workplace.stackexchange.com/questions/13527",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/7468/"
] | I recently joined an organization in which I am to be one of the two new lead developers on the public website. The previous developer (who was alone) left a sizable codebase which although functional, is rigid and fragile. Normally, the saying goes "if it ain't broke don't fix it", but in this case the poor coding style and lack of documentation makes the code unreadable (to me, the other developer, and our interns) and thus require extra time when adding features, tweaking things. Both my partner and I have deemed it essential for both our mental well-being as well as necessary if the development teams are to progress on the organization's schedule.
The problem is that our boss, who is also the head of the organization (biology phD, not a developer) thinks that the last guy was brilliant, and doesn't believe that a rewrite is necessary. Both my partner and I have attempted to [contact the previous developer](https://workplace.stackexchange.com/questions/9785/is-it-tactful-to-get-in-touch-with-a-previous-developer), but to no avail - it appears that he has disappeared off the face of the earth. How do I/we convince the boss the code is in dire need of a major rewrite?
Past Action:
* We've informed our boss the code is a mess
* We've showed him the code (he responds, "what's wrong with it?")
**EDIT**
I'm am almost completely certain a rewrite is needed. I apologize to all the non-pythonistas out there, but the code looks like this:
```
def index(request):
return render(request,'index.html',locals())
```
repeated for perhaps 20 of the 30 "view" functions in the code. For those of you who don't understand, this type of code essentially requires every member of the team to memorize what is used for each template, and makes it difficult to change the code without breaking anything. From what I could tell, the previous developer had no more than 1 year worth of experience coding, and perhaps none professionally. The code is quite buggy right now, and nobody can quite figure out where/why.
If it changes anything, this is a non-profit research organization so grabbing market share isn't *that* important, but since members generally stay for about a year or so (while doing their post-doc work) I think readability/ease of maintenance is probably the single largest thing we need (other than functionality). | First, 'needs a rewrite' is vague. You have to be able to draw boxes around offending code or definitions.
If the old developer wrote code that left the site exposed to SQL injection attacks, show your boss before and after (what you have, what it should be, and the consequences of the old style). Is the application simply forms with no classes for tables, no data services, no user controls, and no unit tests? Then show him how you go through 50 forms making in-situ code edits when a single column added to a table. Inconsistencies - show him Form A done one way and Form B done another, and why they should have more in common.
If that doesn't work, you'll have to show him badly structure biological systems, and explain why the code you have is equivalent to global warming and ocean acidification.
Given further details (Python and scattered global variable use) I would describe the present system in the following terms: 'Within this 200,000 line codebase there are definitions that 'visible' to any line of code, and these definitions are scattered at random in the files. If anyone changes or adds any of these definitions, then everyone involved in the project has to know about them before they make any modifications on their part. One programmer doing this by himself can keep this straight, but that's not how we're doing it. We need to designate certain places for things to be, certain rules for things to follow, and certain patterns that, if we know how one is done, we kind of know what to expect for all similar structures.'
Start paging down through the files while your boss is remoted in or looking over your shoulder, searching for the globals, and ask your boss to memorize each one. Then tell him you'll have to bring him up to speed any time anyone of the programmers changes or adds any of those variables. Have some kind of structural documentation that explains what your target is, and the minimum cost approach to reaching it.
Another approach: hint that you have a spreadsheet with 100 pages. Each page has 1000 rows times 100 columns of values. Within these 100 pages there are 100 'primitive' cells that have no formula - all other cells are calculated from these 100 'primitives'. His job is to know where all those 100 primitive cells are and keep in his head what they do to affect the spreadsheet calculations. Cells are in different locations in each spreadsheet and none have special highlighting, fonts, or backgrounds. Given this spreadsheet, ask 3 people to make structural changes (not simply data elements), which in some cases involves adding a few more 'primitive' cells. It's up to everyone on the team to make sure these changes are coordinated. |
13,738 | <p>I'm working for small well growing company handling offshore projects. Here I'm working as a Software Developer(not experienced) Here is my problem, Currently I have been shifted to a new project and here I used to send 3 types of status emails.</p>
<blockquote>
<ol>
<li>Daily Status email</li>
<li>Weekly Status email to my CEO</li>
<li>Weekly status email to my client</li>
</ol>
</blockquote>
<p>The format I'm using for Status Report is as follows:</p>
<p><strong>1. Daily Status email:</strong></p>
<pre><code> 2. Task Completed
//tasks I have completed today
3. In-Progess
//task I'm that I have in pipeline or working
4. ToDos
//ToDos list of tasks
5. Issues Facing
//Incase if I suffer I used to mention it here
</code></pre>
<p><strong>2. Weekly Status email to my CEO:</strong></p>
<pre><code>> Very similar list in my Daily report that I have worked all long a
> week
</code></pre>
<p><strong>3. Weekly status email to my client(used to send a copy to my CEO):</strong></p>
<pre><code>Here I never use the above format. I used to type in a paragraph saying I
have worked on these items, I am going to do these things on coming on
coming week and atlast if I need any review or any help I used to mention at
last.
</code></pre>
<p><em>My CEO feels I am doing seeing the big picture of the project, goofing emails, improper usage of English, can't even make a sentence,programming is not only the area,etc.,</em></p>
<blockquote>
<p>Here I'm complaining about him. I can understand, he is trying to
improve my activities. Before sending those email I even used to get
reviewed it with my seniors but still get punches from my boss because
of these thing I'm not able to concentrate in my programming.</p>
</blockquote>
<p>I'm totally nowhere to share these things. I am trying to read books to make good email, how to interact,etc., I can't really find one good approach. Sometimes I even used to think I am not fit to make even sentences. Please share some suggestion to overcome from this state, past 2 weeks I am really confused. I don't want to give up and I even never thought of it, I like to work here.</p>
<p>Please pardon me for my bad English. <strong>I don't know where to tag it. Feel free to edit my post with good English.</strong></p>
<p>Thanks for reading this. I got three days of time, I'm ready to busy books if needed.</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 13739,
"author": "Michael Grubey",
"author_id": 9133,
"author_profile": "https://workplace.stackexchange.com/users/9133",
"pm_score": 1,
"selected": false,
"text": "<p>It is very important to ensure your boss does not feel forgotten about. Often in the world of business so... | 2013/08/09 | [
"https://workplace.stackexchange.com/questions/13738",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/9213/"
] | I'm working for small well growing company handling offshore projects. Here I'm working as a Software Developer(not experienced) Here is my problem, Currently I have been shifted to a new project and here I used to send 3 types of status emails.
>
> 1. Daily Status email
> 2. Weekly Status email to my CEO
> 3. Weekly status email to my client
>
>
>
The format I'm using for Status Report is as follows:
**1. Daily Status email:**
```
2. Task Completed
//tasks I have completed today
3. In-Progess
//task I'm that I have in pipeline or working
4. ToDos
//ToDos list of tasks
5. Issues Facing
//Incase if I suffer I used to mention it here
```
**2. Weekly Status email to my CEO:**
```
> Very similar list in my Daily report that I have worked all long a
> week
```
**3. Weekly status email to my client(used to send a copy to my CEO):**
```
Here I never use the above format. I used to type in a paragraph saying I
have worked on these items, I am going to do these things on coming on
coming week and atlast if I need any review or any help I used to mention at
last.
```
*My CEO feels I am doing seeing the big picture of the project, goofing emails, improper usage of English, can't even make a sentence,programming is not only the area,etc.,*
>
> Here I'm complaining about him. I can understand, he is trying to
> improve my activities. Before sending those email I even used to get
> reviewed it with my seniors but still get punches from my boss because
> of these thing I'm not able to concentrate in my programming.
>
>
>
I'm totally nowhere to share these things. I am trying to read books to make good email, how to interact,etc., I can't really find one good approach. Sometimes I even used to think I am not fit to make even sentences. Please share some suggestion to overcome from this state, past 2 weeks I am really confused. I don't want to give up and I even never thought of it, I like to work here.
Please pardon me for my bad English. **I don't know where to tag it. Feel free to edit my post with good English.**
Thanks for reading this. I got three days of time, I'm ready to busy books if needed.
Thanks in advance. | With all communications, there are two important parts - the sender, and the receiver.
The most important thing about any communications is that the sender is conveying what the receiver needs to hear, and that the receiver understands what is being conveyed by the sender.
In this case, you should talk to the recipient(s) of your Status Report and ask:
* What information do you need from me in my Status Report? and
* Is what I am sending understandable?
Talk with your boss, your CEO, and your client. Ask them how you are doing so far and what you need to change. If you hear that something is lacking, try another version, send it to them, and ask for their feedback. Keep it up until everyone has their needs met.
Good luck! |
14,884 | <p>I'm reading an example of what a profile summary might say, and it goes:</p>
<pre><code>I'm a team player, hard worker, and ...
</code></pre>
<p>What is the word on using phrases like that? Does "hard worker" sound too ambiguous or cliche? For some reason it makes me cringe slightly, as to believe it was a copy-pasted phrase something I found. Should it rather be something like "strong work ethic"?</p>
| [
{
"answer_id": 14885,
"author": "Joel Etherton",
"author_id": 10553,
"author_profile": "https://workplace.stackexchange.com/users/10553",
"pm_score": 4,
"selected": true,
"text": "<p>This kind of common jargon has come to be expected. It would be impossible to remove it entirely without ... | 2013/10/05 | [
"https://workplace.stackexchange.com/questions/14884",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/761/"
] | I'm reading an example of what a profile summary might say, and it goes:
```
I'm a team player, hard worker, and ...
```
What is the word on using phrases like that? Does "hard worker" sound too ambiguous or cliche? For some reason it makes me cringe slightly, as to believe it was a copy-pasted phrase something I found. Should it rather be something like "strong work ethic"? | This kind of common jargon has come to be expected. It would be impossible to remove it entirely without taking the "teeth" out of your CV or resume. However, if your cover letter is in English (I can't say for other languages), the language is flexible enough to be able to stretch these phrases through paraphrasing. Try transforming phrases using stronger adjectives and synonyms. `Hard worker` becomes `tireless, driven <programmer, account manager, marketing associate>`. `Team player` becomes `dedicated to the success of my teammates`, etc.
Someone who is REALLY reading your cover letter will see right through these tricks, but that person also won't care or might even take your letter a little more seriously because of the effort you've put into it.
In the end, it will be the skills and performance markers you list in your resume that will get the hiring manager interested in you. The cover letter is a nice lead-in to the real information, and it should be peppered with at least something that gets the hiring manager interested in seeing what lies on the next page. |
15,263 | <p>I have been working on the development of a platform for the past 2 years. But my team (Tools/Development) is a small team within a large QC (Quality Control) team. Unfortunately my job title has to be kept like "Software Engineer - QC" only. The company policies don't allow it to be changed to "Software Developer" or anything else related to development.</p>
<p>Now I am looking for a new job. I am very confused whether my current designation is going to lessen my chances in getting opportunities in software development. How can I let potential hirers and headhunters know that I have been actually doing software development? How should I approach headhunters and interviewers about this?</p>
| [
{
"answer_id": 15264,
"author": "Neuromancer",
"author_id": 10870,
"author_profile": "https://workplace.stackexchange.com/users/10870",
"pm_score": 1,
"selected": false,
"text": "<p>I would write your CV to use general titles that reflect your actual Job - at BT my grade was (MPG 2) but... | 2013/10/24 | [
"https://workplace.stackexchange.com/questions/15263",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/11012/"
] | I have been working on the development of a platform for the past 2 years. But my team (Tools/Development) is a small team within a large QC (Quality Control) team. Unfortunately my job title has to be kept like "Software Engineer - QC" only. The company policies don't allow it to be changed to "Software Developer" or anything else related to development.
Now I am looking for a new job. I am very confused whether my current designation is going to lessen my chances in getting opportunities in software development. How can I let potential hirers and headhunters know that I have been actually doing software development? How should I approach headhunters and interviewers about this? | With your job title, you put some of your activities and achievements. Those will show that you've done development, not just QC work. Companies understand that titles don't always reflect the job done, nor are they consistant from company to company. What you did at that job is always more important than your title, and your resume should be clear in showcasing what you did.
```
Acme, Inc (Software Engineer - QC) - June 2009 to present
On a team of 8, developed software in C# with a SQL Server backend, also using
Java, SSIS, and a bit of C++. Worked with users developing new software.
Implemented a process that reduced bug reports by 10%, and led the process
changing from standard waterfall to agile.
``` |
15,311 | <p>Today on <a href="http://careers.stackoverflow.com">http://careers.stackoverflow.com</a> I saw a job add for a position in Berlin, which listed one of benefits :</p>
<pre><code>casual dress: shorts, flip-flops, tshirts, you name it!
</code></pre>
<p>I know that such dressing is a big no-no for a job, and less for an interview, in conservative areas (and Germany is very conservative, considering there are people to advise how to dress up, and prepare people for an interview).</p>
<p>But would it be ok to show up badly dressed (for example in flip-flops) to test if they said it is ok?</p>
| [
{
"answer_id": 15312,
"author": "Jim G.",
"author_id": 437,
"author_profile": "https://workplace.stackexchange.com/users/437",
"pm_score": 3,
"selected": false,
"text": "<p>No. Here's why:</p>\n\n<ul>\n<li>At that interview, you will be selling the hiring company on your own personal bra... | 2013/10/26 | [
"https://workplace.stackexchange.com/questions/15311",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/149/"
] | Today on <http://careers.stackoverflow.com> I saw a job add for a position in Berlin, which listed one of benefits :
```
casual dress: shorts, flip-flops, tshirts, you name it!
```
I know that such dressing is a big no-no for a job, and less for an interview, in conservative areas (and Germany is very conservative, considering there are people to advise how to dress up, and prepare people for an interview).
But would it be ok to show up badly dressed (for example in flip-flops) to test if they said it is ok? | My guideline for this is to always dress "a notch" better than what I would wear everyday on that job so that would be "no" to your question.
You will have the occasion to see if they "mean" their policy of loose dress code when you actually go for the interview and see the other employees and how they are dressed. |
15,560 | <p>I am in charge of a small, small, small company of 5 people. Usually for companies of that size it is always the same problem, one person needs to do multiple things and it is always time challenging to get things done in time.</p>
<p>I really want to improve things and prepare company for future growth (additional employees) , but it is frustrating because it appears that I am running in circles. So I decided the best way is to organize training, keep as few possible tasks / per person. My conclusion was if everybody clearly knows what to do and how to do it, it will be possible to get better results and hire more people to follow the footsteps.</p>
<p>Since our core business is the most important thing, I decided to have 3 people in our main dept. and 2 people will do support so main department runs smoothly (customer support, IT support).</p>
<p>1 person from the 3 person dept would be a team leader and she is assigned to:</p>
<ul>
<li>lead projects</li>
<li>lead training</li>
<li>track and report project results</li>
</ul>
<p>Training is something that is new to our business. We have always had training, but it wasn't organized, it was ad-hoc.</p>
<pre><code>What is the difference or use of:
- Work books
- Reference manuals
- Training manual
- Job aid
and how to efficiently organize processes:
- before training
- during the training
- after training (support, manuals, help)
</code></pre>
| [
{
"answer_id": 15562,
"author": "Onno",
"author_id": 1975,
"author_profile": "https://workplace.stackexchange.com/users/1975",
"pm_score": 2,
"selected": false,
"text": "<p>First of all, you'll need mutual understanding for need to have the training in the first place. This will ensure t... | 2013/11/08 | [
"https://workplace.stackexchange.com/questions/15560",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/11215/"
] | I am in charge of a small, small, small company of 5 people. Usually for companies of that size it is always the same problem, one person needs to do multiple things and it is always time challenging to get things done in time.
I really want to improve things and prepare company for future growth (additional employees) , but it is frustrating because it appears that I am running in circles. So I decided the best way is to organize training, keep as few possible tasks / per person. My conclusion was if everybody clearly knows what to do and how to do it, it will be possible to get better results and hire more people to follow the footsteps.
Since our core business is the most important thing, I decided to have 3 people in our main dept. and 2 people will do support so main department runs smoothly (customer support, IT support).
1 person from the 3 person dept would be a team leader and she is assigned to:
* lead projects
* lead training
* track and report project results
Training is something that is new to our business. We have always had training, but it wasn't organized, it was ad-hoc.
```
What is the difference or use of:
- Work books
- Reference manuals
- Training manual
- Job aid
and how to efficiently organize processes:
- before training
- during the training
- after training (support, manuals, help)
``` | so with a small group like yours it's very hard to pick a one size fits all solution. Training gets really expensive, and you want to make sure you're spending the time and money in the areas that are most critical to the business, and giving flexibility for the company to adapt to change as time goes on.
**Staff Assignments**
I'd offer the idea the the "everyone does everything" approach is viable up to about 20 people. In the range of 20-80 people you need to start segmenting work, and saying that certain activities are only ever done by a certain team within the company. What you want to avoid on a 5 person team is a case where only 1 person knows how to do a certain key task, as the risk of issues due to chokepoints and people not being available in a crunch period often outweighs the inefficiency of people having to learn how to do many things.
One way to do this that worked on a small team I lead was the idea of "primary" and "secondary" in a given critical area. For us, it was specialization for given projects - we'd always have a primary person who was the final word on how to do the work, and who was expected to do it most of the time, but we had a secondary person who could leap in at a moment's notice. They may not be as efficient as the primary, but they were competent enough that it was unlikely that mistakes would be made.
**Knowledge Transfer**
In terms of "how do people learn to do tasks", I'd offer the idea that you want to mix on the job learning with formal training. I'd break it down these ways:
* **Industry Knowledge** - if the person needs to learn a technical area that is common to their field or industry, assume that most people can get 80-90% of what they need on the Internet. Plan a small budget for book requests and a simple system for making a request for that budget. People learn differently, so one person will thrive on a site like Stack Exchange, another will like a how to or reference book, another will thrive on YouTube videos or similar. Let the learners pick how they learn and what they need to learn, and make the general guidelines clear - for example, if you have a limited budget, give some examples of appropriate spending - 1-3 books/year, 1 bootcamp/year, etc. That way people don't assume your supply is limitless.
* **Coordinated Process** - every company, as it grows, establishes some company specific processes. This is what lets people work together with efficiency, even when they don't know each other well. Information on how to do these processes won't be available on the Internet - it's better some place access controlled for the employees. At a minimum, it should be written down and kept up to date, which means you need to appoint someone to be in charge of that. From there, you may want to consider ways of getting new folks into the processes - buddy systems, mentorships, internal classes - any of it can work, it's just a matter of culture and style.
* **Common How Tos** - After a while, you grow a collective knowledge of what works and what doesn't in your environment. The easy example is the development environment of an engineering group - the tools are complex, the product is complex and getting the tools to work on the product efficiently is often a matter of many design choices, historical knowledge and the existing environment. Rather than making a new person struggle through it, you need to decide how this information gets conveyed - some groups make scripts to automate, some have documentation, some do job shadowing - the one thing I'd advocate is that sticking someone in a room and telling them how to do something is never as good as having them try and giving them help as they go.
How much of this you need will evolve over time. It takes serious time to craft each process or how-to guide, and doing it really early, before it has become a real standard can be a big waste of time. So there's a point where you'll figure out that if the last 3 new guys had problems, it's probably time to formalize a bit.
**Onboarding**
There's typically a problem in small groups with onboarding. There's always a spurt along the way where there is a long gap of no new people and then the company takes off and you can hire like mad. All of a sudden, the team that figured all sorts of things out must now figure out how transfer all that wisdom to the new folks while simultaneously doing their jobs.
That's the real curve and I'd say there's probably no way to handle it perfectly.
Tips I've seen that help are:
* Get the managers aware that regular checkins with the new person are very important
* Buddies or other ways of connecting the new person to a peer who will help them can be very useful, but only if there is a good relationship between the two people.
* Keep track of the issues the new person has, these are the main training areas that need to be addressed. Often big problems come from inconsistencies across the team, so it can be a good test of where you may need larger training.
* Update documentation and resources right after the new person starts succeeding, so that you have recent information on what works.
**Adult Learning**
When it comes to formal training programs, use the information above as a guide for *where* to train folks. That said, there's some general tips from an adult learning perspective:
* Different generations and different cultures have different learning styles. The Internet generation, for example, is extremely comfortable with Internet resources, including YouTube, Q&A sites, "Googling" for answers, and absorbing information in the somewhat haphazard scattershot way that the Internet provides. But a person in the Baby Boomer generation may find all of that very challenging and want something more structured (or not, there is no generalization that applies to everyone).
* There's a general breakdown of learning into different ways of absorbing information - for example - reading it, hearing it, writing it down, asking questions and having them answered, seeing it done, doing it yourself and getting feedback - different individuals will get more or less benefit out of a given activity, and some learning areas require certain activities - for example, sky diving pretty much has to start with non-practice activities first - listening, reading, Q&A - then with mentored activity (doing a run with an instructor some number of times), then with trying it all by yourself. The nature of the feedback (plummeting to the grown w/out a chute) is so severe that you really want to be careful in how you train people. OTOH, often times writing code by yourself in a new environment IS the best form of software training - there's a lot be learned by failing on your own a bit and letting the computer give you feedback.
* A real key that many training programs forget is that there's a use or loose it cycle to the human brain. Whatever you learn in a short span of time will only stay in your brain if you activity use it some short time later. If you learn it "just in case" and don't think about it again for half a year, it WILL be gone and have to be relearned. Often training is "just in time" - ie, just before you need it. But it can also be far in the future so long as there's a way of reminding people of what they know. Taking a quiz the day after may be helpful, but taking a similar quiz every month for 6 months will really help solidify the knowledge.
* This also forms the core difference between a training guide and a reference book. A training guide will generally give someone a complete concept that they can put into practice in the short term. A reference book assumes that it's storing knowledge for someone to use in the long term, and that the person only needs to know to look it up in the book, they don't need it memorized. That's why the organization of these books is often quite different.
I really feel there's no one right way for training. It has as much to do with the group you hire and what you're trying to teach as any particular "best practice overall". I'll say that in the last 5 years, there's been a lot of really interesting work on how we learn and how brains work that leads me to think that the best process of all is one that can change and adapt given new information - both from your employees, and from science. |