qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
sequence
input
stringlengths
12
45k
output
stringlengths
2
31.8k
411,774
<p>Where is my mistake? html code</p> <pre><code>&lt;div class=&quot;star-rating&quot;&gt; &lt;span class=&quot;postid&quot; post-id=&quot;52&quot;&gt;&lt;/span&gt; &lt;span class=&quot;score-bg&quot;&gt;&lt;/span&gt; &lt;div class=&quot;scores&quot;&gt; &lt;?php for ($i = 1; $i &lt;= 5; $i++): ?&gt; &lt;div class=&quot;score&quot; data-score=&quot;&lt;?php echo $i; ?&gt;&quot;&gt; &lt;span class=&quot;scoreAbsolute&quot;&gt;&lt;/span&gt; &lt;/div&gt; &lt;?php endfor; ?&gt; &lt;/div&gt; </code></pre> <pre><code>jQuery(document).ready(function ($) { $(function () { $(&quot;.score&quot;).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 Wordpress to 6.1 and it worked.</p>\n" }, { "answer_id": 411672, "author": "rexkogitans", "author_id": 196282, "author_profile": "https://wordpress.stackexchange.com/users/196282", "pm_score": 1, "selected": false, "text": "<p>Too long for a comment, but here is a suggestion. What have you done so far? I recently moved a site successfully like this:</p>\n<ol>\n<li>Dump DB</li>\n<li>In the Dump, replace every occurence of the old site URL by the new site URL.</li>\n<li>Copy over the entire directory</li>\n<li>Fit the configuration <code>wp-config.php</code> (DB access, site URL, TLS proxy)</li>\n<li>Replay the modified dump in the new database</li>\n<li>Load WordPress</li>\n<li>Flush all caches, if there are some</li>\n</ol>\n<p>Note that points 2 and 4 are crucial.</p>\n" } ]
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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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>&lt;?php if (is_user_logged_in()): ?&gt; var element = document.getElementById(&quot;elementor-element-f4e5a8e&quot;); element.classList.add(&quot;logged-in&quot;); &lt;?php else: ?&gt; var element = document.getElementById(&quot;elementor-element-f4e5a8e&quot;); element.classList.remove(&quot;logged-out&quot;); &lt;?php endif; ?&gt; </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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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 &quot;custompost_type&quot; 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) =&gt; { 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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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' =&gt; 'docs', 'date_query' =&gt; array( array( 'after' =&gt; '1 week ago', 'inclusive' =&gt; true))] ); $docs_num = count( $posts ); $labels = []; $dataCount = []; foreach ( $posts as $item ) { $labels[] = date('d M, Y', strtotime($item-&gt;post_date)); $dataCount[] = get_post_meta( $item-&gt;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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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 &gt; 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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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' =&gt; array( 'relation' =&gt; 'AND', 'lastname' =&gt; array( 'key' =&gt; 'last_name', 'compare' =&gt; 'EXISTS', 'type' =&gt; 'CHAR', ), 'list' =&gt; array( 'distribution_list' =&gt; array( 'key' =&gt; 'distribution_list', 'value' =&gt; '&quot;72&quot;', 'compare' =&gt; 'LIKE' ), 'distribution_list2' =&gt; array( 'key' =&gt; 'distribution_list', 'value' =&gt; '&quot;72&quot;', 'compare' =&gt; 'NOT LIKE' ), 'relation' =&gt; 'OR', ), ) 'orderby' =&gt; array( 'distribution_list' =&gt; 'ASC', 'last_name' =&gt; '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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/image/image.jpg&quot;</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 function. This means that the variable is only accessible inside this function, and it is not visible to other functions or code outside of this function.</p>\n<p>In order to make the $latestversion variable available to other functions or code, you can use the global keyword to explicitly declare that you want to use the global version of this variable, rather than a local variable with the same name. Here is an example of how you could modify your code to do this:</p>\n<pre><code>function plugin_version_check() {\nglobal $latestversion;\n$latestversion = (something);\nreturn $latestversion;\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file ) {\nglobal $latestversion;\n\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n<p>By using the global keyword, you are telling PHP that you want to use the global version of the $latestversion variable inside the dk_plugin_meta_links function. This allows you to access the value of this variable that was set in the plugin_version_check function.</p>\n<p>Alternatively, you could pass the $latestversion variable as an argument to the dk_plugin_meta_links function, like this:</p>\n<pre><code>function plugin_version_check() {\n$latestversion = (something);\ndk_plugin_meta_links(null, null, $latestversion);\n} \ndo_action('wp_login', 'plugin_version_check');\n\nfunction dk_plugin_meta_links( $links, $file, $latestversion ) {\n// Use the value of $latestversion here \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 3 );\n</code></pre>\n<p>In this example, the $latestversion variable is passed as an argument to the dk_plugin_meta_links function, which allows you to access the value of this variable inside the function. This is a cleaner and more modular approach than using global variables, and it can help avoid potential conflicts or bugs in your code.</p>\n" }, { "answer_id": 411835, "author": "Steve", "author_id": 25717, "author_profile": "https://wordpress.stackexchange.com/users/25717", "pm_score": 0, "selected": false, "text": "<p>The solution for this was a compromise</p>\n<p>I moved the code from the <code>wp_login</code> hook into my meta_links function and test to see if my value exists</p>\n<pre><code>function dk_plugin_meta_links( $links, $file ) {\n\n if($latestversion == &quot;&quot;) {\n //get the latest version if we don't already have it\n }\n\n (do something with) $latestversion; \n}\nadd_filter( 'plugin_row_meta', 'dk_plugin_meta_links', 10, 2 );\n</code></pre>\n" } ]
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(){ ?&gt; &lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot; /&gt; &lt;?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 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.</p>\n<p>Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.</p>\n<p>Also, we should have debugging enabled on development and staging sites. Often it's done by having different <code>wp-config.php</code> files (excluded from Git) on development, staging and production sites.</p>\n<p>You may even take advantage of that and set the following <code>true</code> on dev and staging, and false on production:</p>\n<pre><code>define( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_DISPLAY', true );\n</code></pre>\n<p>Then never set these to <code>true</code> on production, at least not <code>WP_DEBUG_DISPLAY</code>. 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 <code>WP_DEBUG_DISPLAY</code> on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.</p>\n<p>Here's how the plugin code would look like:</p>\n<pre><code>&lt;?php\n/*\n Plugin Name: Custom No Index\n Description: A plugin to add a noindex, nofollow meta tag to the head of every page.\n Author: Fayaz Ahmed\n Version: 1.0\n*/\n\nadd_action( 'wp_head', 'no_index_on_debug' );\nfunction no_index_on_debug() {\n if( WP_DEBUG &amp;&amp; WP_DEBUG_DISPLAY ) {\n ?&gt;\n &lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot; /&gt;\n &lt;?php\n }\n}\n</code></pre>\n<h2>Use Google Search Console</h2>\n<p>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:</p>\n<ol>\n<li><p>Go to <a href=\"https://search.google.com/search-console/\" rel=\"nofollow noreferrer\">https://search.google.com/search-console/</a> and sign in with your Google account.</p>\n</li>\n<li><p>Select the property (website) that represents your staging site from the list of properties.</p>\n</li>\n<li><p>From the left menu go to: <code>Indexing</code> → <code>Removals</code>, and in the <code>Temporary Removals</code> Tab, use the <kbd>NEW REQUEST</kbd> button to submit URLs for removal.</p>\n</li>\n</ol>\n<p>It may take some time for Google to process the request to remove the URLs from search results. You can also use the &quot;URL inspection&quot; tool in Search Console to check the status of your request and see if the URL has been removed from the search results.</p>\n" }, { "answer_id": 412237, "author": "Trisha", "author_id": 56458, "author_profile": "https://wordpress.stackexchange.com/users/56458", "pm_score": 0, "selected": false, "text": "<p>Why not just use the Setting under Settings&gt;Reading Settings, tick the box that says &quot;Discourage search engines from indexing this site&quot;.</p>\n<p>That does the same thing as the code above, no need for any plugin.</p>\n" } ]
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'] ) &amp;&amp; !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 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.</p>\n<p>Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.</p>\n<p>Also, we should have debugging enabled on development and staging sites. Often it's done by having different <code>wp-config.php</code> files (excluded from Git) on development, staging and production sites.</p>\n<p>You may even take advantage of that and set the following <code>true</code> on dev and staging, and false on production:</p>\n<pre><code>define( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_DISPLAY', true );\n</code></pre>\n<p>Then never set these to <code>true</code> on production, at least not <code>WP_DEBUG_DISPLAY</code>. 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 <code>WP_DEBUG_DISPLAY</code> on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.</p>\n<p>Here's how the plugin code would look like:</p>\n<pre><code>&lt;?php\n/*\n Plugin Name: Custom No Index\n Description: A plugin to add a noindex, nofollow meta tag to the head of every page.\n Author: Fayaz Ahmed\n Version: 1.0\n*/\n\nadd_action( 'wp_head', 'no_index_on_debug' );\nfunction no_index_on_debug() {\n if( WP_DEBUG &amp;&amp; WP_DEBUG_DISPLAY ) {\n ?&gt;\n &lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot; /&gt;\n &lt;?php\n }\n}\n</code></pre>\n<h2>Use Google Search Console</h2>\n<p>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:</p>\n<ol>\n<li><p>Go to <a href=\"https://search.google.com/search-console/\" rel=\"nofollow noreferrer\">https://search.google.com/search-console/</a> and sign in with your Google account.</p>\n</li>\n<li><p>Select the property (website) that represents your staging site from the list of properties.</p>\n</li>\n<li><p>From the left menu go to: <code>Indexing</code> → <code>Removals</code>, and in the <code>Temporary Removals</code> Tab, use the <kbd>NEW REQUEST</kbd> button to submit URLs for removal.</p>\n</li>\n</ol>\n<p>It may take some time for Google to process the request to remove the URLs from search results. You can also use the &quot;URL inspection&quot; tool in Search Console to check the status of your request and see if the URL has been removed from the search results.</p>\n" }, { "answer_id": 412237, "author": "Trisha", "author_id": 56458, "author_profile": "https://wordpress.stackexchange.com/users/56458", "pm_score": 0, "selected": false, "text": "<p>Why not just use the Setting under Settings&gt;Reading Settings, tick the box that says &quot;Discourage search engines from indexing this site&quot;.</p>\n<p>That does the same thing as the code above, no need for any plugin.</p>\n" } ]
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 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.</p>\n<p>Changing the themes back and forth in the staging and production is not a good idea. It may accidentally de-index your main site.</p>\n<p>Also, we should have debugging enabled on development and staging sites. Often it's done by having different <code>wp-config.php</code> files (excluded from Git) on development, staging and production sites.</p>\n<p>You may even take advantage of that and set the following <code>true</code> on dev and staging, and false on production:</p>\n<pre><code>define( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_DISPLAY', true );\n</code></pre>\n<p>Then never set these to <code>true</code> on production, at least not <code>WP_DEBUG_DISPLAY</code>. 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 <code>WP_DEBUG_DISPLAY</code> on production (which you shouldn't do anyway), neither on the files, nor on the database or admin settings.</p>\n<p>Here's how the plugin code would look like:</p>\n<pre><code>&lt;?php\n/*\n Plugin Name: Custom No Index\n Description: A plugin to add a noindex, nofollow meta tag to the head of every page.\n Author: Fayaz Ahmed\n Version: 1.0\n*/\n\nadd_action( 'wp_head', 'no_index_on_debug' );\nfunction no_index_on_debug() {\n if( WP_DEBUG &amp;&amp; WP_DEBUG_DISPLAY ) {\n ?&gt;\n &lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot; /&gt;\n &lt;?php\n }\n}\n</code></pre>\n<h2>Use Google Search Console</h2>\n<p>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:</p>\n<ol>\n<li><p>Go to <a href=\"https://search.google.com/search-console/\" rel=\"nofollow noreferrer\">https://search.google.com/search-console/</a> and sign in with your Google account.</p>\n</li>\n<li><p>Select the property (website) that represents your staging site from the list of properties.</p>\n</li>\n<li><p>From the left menu go to: <code>Indexing</code> → <code>Removals</code>, and in the <code>Temporary Removals</code> Tab, use the <kbd>NEW REQUEST</kbd> button to submit URLs for removal.</p>\n</li>\n</ol>\n<p>It may take some time for Google to process the request to remove the URLs from search results. You can also use the &quot;URL inspection&quot; tool in Search Console to check the status of your request and see if the URL has been removed from the search results.</p>\n" }, { "answer_id": 412237, "author": "Trisha", "author_id": 56458, "author_profile": "https://wordpress.stackexchange.com/users/56458", "pm_score": 0, "selected": false, "text": "<p>Why not just use the Setting under Settings&gt;Reading Settings, tick the box that says &quot;Discourage search engines from indexing this site&quot;.</p>\n<p>That does the same thing as the code above, no need for any plugin.</p>\n" } ]
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 &quot;Wordpress&quot;. 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] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-includes/canonical.php [line] =&gt; 801 [function] =&gt; wp_redirect [args] =&gt; Array ( [0] =&gt; https://stgtrulite.wpengine.com/ [1] =&gt; 301 ) ) [1] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php [line] =&gt; 308 [function] =&gt; redirect_canonical [args] =&gt; Array ( [0] =&gt; https://stgtrulite.wpengine.com/platform/xxx ) ) [2] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-includes/class-wp-hook.php [line] =&gt; 332 [function] =&gt; apply_filters [class] =&gt; WP_Hook [object] =&gt; WP_Hook Object ( [callbacks] =&gt; Array ( [0] =&gt; Array ( [_wp_admin_bar_init] =&gt; Array ( [function] =&gt; _wp_admin_bar_init [accepted_args] =&gt; 1 ) ) [10] =&gt; Array ( [wp_old_slug_redirect] =&gt; Array ( [function] =&gt; wp_old_slug_redirect [accepted_args] =&gt; 1 ) [redirect_canonical] =&gt; Array ( [function] =&gt; redirect_canonical [accepted_args] =&gt; 1 ) [0000000026d0f2cb000000001a0eef68render_sitemaps] =&gt; Array ( [function] =&gt; Array ( [0] =&gt; WP_Sitemaps Object ( [index] =&gt; WP_Sitemaps_Index Object ( [registry:protected] =&gt; WP_Sitemaps_Registry Object ( [providers:WP_Sitemaps_Registry:private] =&gt; Array ( [posts] =&gt; WP_Sitemaps_Posts Object ( [name:protected] =&gt; posts [object_type:protected] =&gt; post ) [taxonomies] =&gt; WP_Sitemaps_Taxonomies Object ( [name:protected] =&gt; taxonomies [object_type:protected] =&gt; term ) [users] =&gt; WP_Sitemaps_Users Object ( [name:protected] =&gt; users [object_type:protected] =&gt; user ) ) ) [max_sitemaps:WP_Sitemaps_Index:private] =&gt; 50000 ) [registry] =&gt; WP_Sitemaps_Registry Object ( [providers:WP_Sitemaps_Registry:private] =&gt; Array ( [posts] =&gt; WP_Sitemaps_Posts Object ( [name:protected] =&gt; posts [object_type:protected] =&gt; post ) [taxonomies] =&gt; WP_Sitemaps_Taxonomies Object ( [name:protected] =&gt; taxonomies [object_type:protected] =&gt; term ) [users] =&gt; WP_Sitemaps_Users Object ( [name:protected] =&gt; users [object_type:protected] =&gt; user ) ) ) [renderer] =&gt; WP_Sitemaps_Renderer Object ( [stylesheet:protected] =&gt; [stylesheet_index:protected] =&gt; ) ) [1] =&gt; render_sitemaps ) [accepted_args] =&gt; 1 ) ) [11] =&gt; Array ( [rest_output_link_header] =&gt; Array ( [function] =&gt; rest_output_link_header [accepted_args] =&gt; 0 ) [wp_shortlink_header] =&gt; Array ( [function] =&gt; wp_shortlink_header [accepted_args] =&gt; 0 ) ) [1000] =&gt; Array ( [wp_redirect_admin_locations] =&gt; Array ( [function] =&gt; wp_redirect_admin_locations [accepted_args] =&gt; 1 ) ) [99999] =&gt; Array ( [0000000026d0f112000000001a0eef68is_404] =&gt; Array ( [function] =&gt; Array ( [0] =&gt; WpeCommon Object ( [options:protected] =&gt; ) [1] =&gt; is_404 ) [accepted_args] =&gt; 1 ) ) ) [iterations:WP_Hook:private] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; 0 [1] =&gt; 10 [2] =&gt; 11 [3] =&gt; 1000 [4] =&gt; 99999 ) ) [current_priority:WP_Hook:private] =&gt; Array ( [0] =&gt; 10 ) [nesting_level:WP_Hook:private] =&gt; 1 [doing_action:WP_Hook:private] =&gt; 1 ) [type] =&gt; -&gt; [args] =&gt; Array ( [0] =&gt; [1] =&gt; Array ( [0] =&gt; ) ) ) [3] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-includes/plugin.php [line] =&gt; 517 [function] =&gt; do_action [class] =&gt; WP_Hook [object] =&gt; WP_Hook Object ( [callbacks] =&gt; Array ( [0] =&gt; Array ( [_wp_admin_bar_init] =&gt; Array ( [function] =&gt; _wp_admin_bar_init [accepted_args] =&gt; 1 ) ) [10] =&gt; Array ( [wp_old_slug_redirect] =&gt; Array ( [function] =&gt; wp_old_slug_redirect [accepted_args] =&gt; 1 ) [redirect_canonical] =&gt; Array ( [function] =&gt; redirect_canonical [accepted_args] =&gt; 1 ) [0000000026d0f2cb000000001a0eef68render_sitemaps] =&gt; Array ( [function] =&gt; Array ( [0] =&gt; WP_Sitemaps Object ( [index] =&gt; WP_Sitemaps_Index Object ( [registry:protected] =&gt; WP_Sitemaps_Registry Object ( [providers:WP_Sitemaps_Registry:private] =&gt; Array ( [posts] =&gt; WP_Sitemaps_Posts Object ( [name:protected] =&gt; posts [object_type:protected] =&gt; post ) [taxonomies] =&gt; WP_Sitemaps_Taxonomies Object ( [name:protected] =&gt; taxonomies [object_type:protected] =&gt; term ) [users] =&gt; WP_Sitemaps_Users Object ( [name:protected] =&gt; users [object_type:protected] =&gt; user ) ) ) [max_sitemaps:WP_Sitemaps_Index:private] =&gt; 50000 ) [registry] =&gt; WP_Sitemaps_Registry Object ( [providers:WP_Sitemaps_Registry:private] =&gt; Array ( [posts] =&gt; WP_Sitemaps_Posts Object ( [name:protected] =&gt; posts [object_type:protected] =&gt; post ) [taxonomies] =&gt; WP_Sitemaps_Taxonomies Object ( [name:protected] =&gt; taxonomies [object_type:protected] =&gt; term ) [users] =&gt; WP_Sitemaps_Users Object ( [name:protected] =&gt; users [object_type:protected] =&gt; user ) ) ) [renderer] =&gt; WP_Sitemaps_Renderer Object ( [stylesheet:protected] =&gt; [stylesheet_index:protected] =&gt; ) ) [1] =&gt; render_sitemaps ) [accepted_args] =&gt; 1 ) ) [11] =&gt; Array ( [rest_output_link_header] =&gt; Array ( [function] =&gt; rest_output_link_header [accepted_args] =&gt; 0 ) [wp_shortlink_header] =&gt; Array ( [function] =&gt; wp_shortlink_header [accepted_args] =&gt; 0 ) ) [1000] =&gt; Array ( [wp_redirect_admin_locations] =&gt; Array ( [function] =&gt; wp_redirect_admin_locations [accepted_args] =&gt; 1 ) ) [99999] =&gt; Array ( [0000000026d0f112000000001a0eef68is_404] =&gt; Array ( [function] =&gt; Array ( [0] =&gt; WpeCommon Object ( [options:protected] =&gt; ) [1] =&gt; is_404 ) [accepted_args] =&gt; 1 ) ) ) [iterations:WP_Hook:private] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; 0 [1] =&gt; 10 [2] =&gt; 11 [3] =&gt; 1000 [4] =&gt; 99999 ) ) [current_priority:WP_Hook:private] =&gt; Array ( [0] =&gt; 10 ) [nesting_level:WP_Hook:private] =&gt; 1 [doing_action:WP_Hook:private] =&gt; 1 ) [type] =&gt; -&gt; [args] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; ) ) ) [4] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-includes/template-loader.php [line] =&gt; 13 [function] =&gt; do_action [args] =&gt; Array ( [0] =&gt; template_redirect ) ) [5] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/wp-blog-header.php [line] =&gt; 19 [args] =&gt; Array ( [0] =&gt; /nas/content/live/stgtrulite/wp-includes/template-loader.php ) [function] =&gt; require_once ) [6] =&gt; Array ( [file] =&gt; /nas/content/live/stgtrulite/index.php [line] =&gt; 17 [args] =&gt; Array ( [0] =&gt; /nas/content/live/stgtrulite/wp-blog-header.php ) [function] =&gt; 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 a plugin installed or a modification in the functions.php file that is removing items from the menu list.</p>\n<p>Log into phpmyadmin for the site, check your username login against those of the other company. Likely the permission level is going to be different.</p>\n<p><em>[Removed instructions for wp_usermeta as it is no longer relevant]</em></p>\n<p>Most likely there is a plugin or edit in the functions.php which is controlling what you see in the admin menu.</p>\n" }, { "answer_id": 412275, "author": "Tamara", "author_id": 28310, "author_profile": "https://wordpress.stackexchange.com/users/28310", "pm_score": 4, "selected": true, "text": "<p>In WordPress, there is no concept of &quot;super admins&quot; in the same way that there is in a multisite installation. However, there may be users with the &quot;administrator&quot; role who have access to all areas of the site, including the WordPress settings.</p>\n<p>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:</p>\n<ul>\n<li>Check that you are logged in with an account that has the &quot;administrator&quot; role.</li>\n<li>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.</li>\n<li>Check if there are any errors in your site's <code>wp-config.php</code> file that may be preventing access to the settings.</li>\n<li>If you are using a caching plugin, try clearing the cache to see if that resolves the issue.</li>\n</ul>\n<p>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 <code>phpMyAdmin</code> to access the database <code>wp_users</code> table and check for any problems.</p>\n<p>while on <code>PHPMyAdmin</code>, 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 <code>wp_usermeta</code> table to see if there are any issues with the user roles.</p>\n<p>To change user roles in the wp_usermeta table in WordPress using phpMyAdmin, you can follow these steps:</p>\n<ol>\n<li><p>Log in to your hosting account and open the phpMyAdmin tool.</p>\n</li>\n<li><p>Select the WordPress database from the list of databases on the left side of the page.</p>\n</li>\n<li><p>Click on the <code>wp_usermeta</code> table to open it.</p>\n</li>\n<li><p>Click on the &quot;Browse&quot; tab to view the contents of the table.</p>\n</li>\n<li><p>Find the row corresponding to the user whose role you want to change. The <code>user_id</code> column will contain the ID of the user, and the <code>meta_key</code> column will contain the string &quot;<code>wp_capabilities</code>&quot;.</p>\n</li>\n<li><p>Click on the &quot;Edit&quot; link for the row you want to modify.</p>\n</li>\n<li><p>In the &quot;meta_value&quot; 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 &quot;administrator&quot;, you would enter the following value in the &quot;meta_value&quot; field: <code>a:1:{s:13:&quot;administrator&quot;;b:1;}</code>.</p>\n</li>\n</ol>\n<p>if a user has the &quot;administrator&quot; role, the <code>wp_capabilities</code> field for that user might contain the following value: <code>a:1:{s:13:&quot;administrator&quot;;b:1;}</code>. This value indicates that the user has the &quot;administrator&quot; role, with the key <code>s:13:&quot;administrator&quot;</code> corresponding to the role and the value <code>b:1;</code> indicating that the <code>role is enabled</code>.</p>\n<ol start=\"8\">\n<li>Click the &quot;Go&quot; button to save the changes.</li>\n</ol>\n<p>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.</p>\n<p>I hope this helps! Let me know if you have any other questions.</p>\n" } ]
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>&lt;?php /** * Title: Post link * Slug: mytheme/post-link */ ?&gt; &lt;!-- wp:html --&gt; &lt;div&gt; &lt;?php $id = $postId; //how can I get it???? $post = get_post($postId); $slug = $post['slug']; ?&gt; &lt;a href=&quot;&lt;?= $slug; ?&gt;&quot;&gt;Some Button leading to a post&lt;/a&gt; &lt;/div&gt; &lt;!-- /wp:html --&gt; </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/functions/get_the_id/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/functions/get_the_id/</a></p>\n<p>Documentation description:</p>\n<blockquote>\n<p>Retrieves the ID of the current item in the WordPress Loop.</p>\n</blockquote>\n<pre class=\"lang-php prettyprint-override\"><code>&lt;?php \n$id = get_the_ID();\n$post = get_post($postId);\n$slug = $post['slug'];\n?&gt;\n</code></pre>\n" }, { "answer_id": 412467, "author": "Dannyboy", "author_id": 227201, "author_profile": "https://wordpress.stackexchange.com/users/227201", "pm_score": 2, "selected": true, "text": "<p>In block themes patterns won't have access to context such as id it seems:<br />\n<a href=\"https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns</a></p>\n<p>One has to create a custom block to get post id and use useSelect hook to get post Id like so:\n<code>import { useSelect } from &quot;@wordpress/data&quot;;</code></p>\n<p>...\ninside Edit block function:</p>\n<p><code>const postId = useSelect(select =&gt; select('core/editor').getCurrentPostId());</code></p>\n<p>then, postId can be used inside edit function and if it has to be used in save function, <code>useEffect</code> should be used inside edit to store id to attribute like so:</p>\n<pre><code>useEffect(() =&gt; { \n if (postId) {\n setAttributes({postId})\n }, [postId]);\n</code></pre>\n<p>Provided you have defined postId attribute in <code>block.json</code>, you can get and use that attribute in save function or render_callback.</p>\n" } ]
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=&quot;3&quot; aid=&quot;selected&quot; data=&quot;answer&quot; uid=&quot;68&quot; session=&quot;last&quot;] </code></pre> <p>I want the <code>id</code> to be variable, like:</p> <pre><code>[survey_records id=&quot;$variable&quot; qid=&quot;3&quot; aid=&quot;selected&quot; data=&quot;answer&quot; uid=&quot;68&quot; session=&quot;last&quot;] </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 that info.</p>\n" }, { "answer_id": 412390, "author": "Conor Treacy", "author_id": 222130, "author_profile": "https://wordpress.stackexchange.com/users/222130", "pm_score": 1, "selected": false, "text": "<p>You can also view source or use inspect element in your browser. From there, search for &quot;theme&quot; 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.</p>\n<p>As @rick mentioned, you can use some searches on Google, or using a site called <a href=\"https://builtwith.com\" rel=\"nofollow noreferrer\">https://builtwith.com</a> 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.</p>\n" } ]
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>&lt;div id=&quot;inner-wrap&quot; class=&quot;wrap hfeed kt-clear&quot;&gt; &lt;?php /** * Hook for top of inner wrap. */ do_action( 'kadence_before_content' ); ?&gt; </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>&lt;table id = &quot;inner-wrap&quot; class=&quot;empTable&quot; border='1'&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;Active&lt;/th&gt; &lt;/tr&gt; &lt;?php /* Template Name: Custom Table */ get_header(); global $wpdb; $result = $wpdb-&gt;get_results ( &quot;SELECT * FROM DBTable&quot; ); foreach ( $result as $print ) { echo '&lt;tr&gt;'; echo '&lt;td&gt;', $print-&gt;name,'&lt;/td&gt;'; echo '&lt;td&gt;', $print-&gt;id,'&lt;/td&gt;'; if($print-&gt;active == 1){ echo '&lt;td&gt;', 'Active','&lt;/td&gt;'; }else{ echo '&lt;td&gt;', 'Inactive','&lt;/td&gt;'; } echo '&lt;/tr&gt;'; }echo '&lt;/table&gt;'; 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 that info.</p>\n" }, { "answer_id": 412390, "author": "Conor Treacy", "author_id": 222130, "author_profile": "https://wordpress.stackexchange.com/users/222130", "pm_score": 1, "selected": false, "text": "<p>You can also view source or use inspect element in your browser. From there, search for &quot;theme&quot; 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.</p>\n<p>As @rick mentioned, you can use some searches on Google, or using a site called <a href=\"https://builtwith.com\" rel=\"nofollow noreferrer\">https://builtwith.com</a> 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.</p>\n" } ]
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' =&gt; '#', ); session_start(); global $post; $title = get_the_title($post-&gt;ID); $a = shortcode_atts($default, $atts); $content = do_shortcode($content); return ' &lt;h2&gt;Download '.$title.' Mp3 Audio&lt;/h2&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;Download Mp3 audio, listen and share this amazing song for free and stay happy.&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;wp-block-audio&quot;&gt;&lt;audio class=&quot;audioPlayer&quot; src=&quot;'.($a['link']).'&quot; controls=&quot;controls&quot;&gt;&lt;/audio&gt;&lt;/figure&gt;&lt;center&gt;&lt;p class=&quot;song-download&quot;&gt;&lt;a rel=&quot;nofollow&quot; id=&quot;dlf&quot; class=&quot;button download&quot; href=&quot;'.($a['link']).'&quot;&gt;&lt;span class=&quot;fa fa-download&quot;&gt;&lt;/span&gt; DOWNLOAD '.$content.' MP3 &lt;span class=&quot;fa fa-music&quot;&gt;&lt;/span&gt; &lt;/a&gt;&lt;/p&gt;&lt;/center&gt;'; } $_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 that info.</p>\n" }, { "answer_id": 412390, "author": "Conor Treacy", "author_id": 222130, "author_profile": "https://wordpress.stackexchange.com/users/222130", "pm_score": 1, "selected": false, "text": "<p>You can also view source or use inspect element in your browser. From there, search for &quot;theme&quot; 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.</p>\n<p>As @rick mentioned, you can use some searches on Google, or using a site called <a href=\"https://builtwith.com\" rel=\"nofollow noreferrer\">https://builtwith.com</a> 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.</p>\n" } ]
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 (&quot;KEZDŐLAP&quot;), 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> for css. which is not a good practice.</p>\n<p>try the following css:</p>\n<pre><code>body.home .woocommerce-products-header__title { display:none; }\n\nbody.home .page-title { display:none; } \n</code></pre>\n" }, { "answer_id": 412546, "author": "Innovative Khan", "author_id": 204382, "author_profile": "https://wordpress.stackexchange.com/users/204382", "pm_score": 0, "selected": false, "text": "<p>It is possible that the CSS selectors with the .page-id-8178 class are being overridden by another CSS rule with a higher specificity. In CSS, the specificity of a rule determines which rule will take precedence when there are conflicting rules for the same element. Rules with higher specificity have a greater weight and will override rules with lower specificity.</p>\n<p>One way to increase the specificity of your CSS selectors is to use the !important rule, as you have done in your code. However, this is not always the best solution, as it can make your CSS code more difficult to maintain and can cause other issues.</p>\n<p>A better solution might be to use more specific CSS selectors that are less likely to be overridden by other rules. For example, you could try using a more specific selector such as .page-id-8178 .entry-title or .page-id-8178 h1.page-title, which targets the title specifically on the homepage with the ID 8178.</p>\n<p>Alternatively, you could try using the :not() pseudo-class to exclude the homepage from the rule that is currently overriding your styles. For example:</p>\n<pre><code>:not(.page-id-8178) .woocommerce-products-header__title {\n display: none;\n}\n:not(.page-id-8178) .page-title {\n display: none;\n}\n</code></pre>\n<p>This will apply the display: none rule to all elements with the woocommerce-products-header__title and page-title classes, except on the homepage with the ID 8178.</p>\n<p>I hope this helps! Let me know if you have any further questions or need additional assistance.</p>\n" } ]
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 &amp; 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> for css. which is not a good practice.</p>\n<p>try the following css:</p>\n<pre><code>body.home .woocommerce-products-header__title { display:none; }\n\nbody.home .page-title { display:none; } \n</code></pre>\n" }, { "answer_id": 412546, "author": "Innovative Khan", "author_id": 204382, "author_profile": "https://wordpress.stackexchange.com/users/204382", "pm_score": 0, "selected": false, "text": "<p>It is possible that the CSS selectors with the .page-id-8178 class are being overridden by another CSS rule with a higher specificity. In CSS, the specificity of a rule determines which rule will take precedence when there are conflicting rules for the same element. Rules with higher specificity have a greater weight and will override rules with lower specificity.</p>\n<p>One way to increase the specificity of your CSS selectors is to use the !important rule, as you have done in your code. However, this is not always the best solution, as it can make your CSS code more difficult to maintain and can cause other issues.</p>\n<p>A better solution might be to use more specific CSS selectors that are less likely to be overridden by other rules. For example, you could try using a more specific selector such as .page-id-8178 .entry-title or .page-id-8178 h1.page-title, which targets the title specifically on the homepage with the ID 8178.</p>\n<p>Alternatively, you could try using the :not() pseudo-class to exclude the homepage from the rule that is currently overriding your styles. For example:</p>\n<pre><code>:not(.page-id-8178) .woocommerce-products-header__title {\n display: none;\n}\n:not(.page-id-8178) .page-title {\n display: none;\n}\n</code></pre>\n<p>This will apply the display: none rule to all elements with the woocommerce-products-header__title and page-title classes, except on the homepage with the ID 8178.</p>\n<p>I hope this helps! Let me know if you have any further questions or need additional assistance.</p>\n" } ]
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>&lt;a href=&quot;domain/newsletter-by-year?year=2020&quot;&gt;GO TO THE NEWSLETTER FROM 2020&lt;/a&gt; </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[&quot;year&quot;]; $args = array( 'post_type' =&gt; 'post', 'category_name' =&gt; 'news-letter', 'posts_per_page' =&gt; 10, 'date_query' =&gt; array( array( 'year' =&gt; $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> for css. which is not a good practice.</p>\n<p>try the following css:</p>\n<pre><code>body.home .woocommerce-products-header__title { display:none; }\n\nbody.home .page-title { display:none; } \n</code></pre>\n" }, { "answer_id": 412546, "author": "Innovative Khan", "author_id": 204382, "author_profile": "https://wordpress.stackexchange.com/users/204382", "pm_score": 0, "selected": false, "text": "<p>It is possible that the CSS selectors with the .page-id-8178 class are being overridden by another CSS rule with a higher specificity. In CSS, the specificity of a rule determines which rule will take precedence when there are conflicting rules for the same element. Rules with higher specificity have a greater weight and will override rules with lower specificity.</p>\n<p>One way to increase the specificity of your CSS selectors is to use the !important rule, as you have done in your code. However, this is not always the best solution, as it can make your CSS code more difficult to maintain and can cause other issues.</p>\n<p>A better solution might be to use more specific CSS selectors that are less likely to be overridden by other rules. For example, you could try using a more specific selector such as .page-id-8178 .entry-title or .page-id-8178 h1.page-title, which targets the title specifically on the homepage with the ID 8178.</p>\n<p>Alternatively, you could try using the :not() pseudo-class to exclude the homepage from the rule that is currently overriding your styles. For example:</p>\n<pre><code>:not(.page-id-8178) .woocommerce-products-header__title {\n display: none;\n}\n:not(.page-id-8178) .page-title {\n display: none;\n}\n</code></pre>\n<p>This will apply the display: none rule to all elements with the woocommerce-products-header__title and page-title classes, except on the homepage with the ID 8178.</p>\n<p>I hope this helps! Let me know if you have any further questions or need additional assistance.</p>\n" } ]
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>&lt;?php $tags = get_the_tags(); print_r($tags); $args = array( &quot;numberposts&quot; =&gt; 3, &quot;post_type&quot; =&gt; &quot;page&quot;, &quot;tax_query&quot; =&gt; array( array( &quot;taxonomy&quot; =&gt; &quot;page_tag&quot;, &quot;field&quot; =&gt; &quot;term_id&quot;, &quot;terms&quot; =&gt; $tags ) ) ); $pages = get_pages( $args ); print_r($pages); ?&gt; </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 specific taxonomy terms assigned.</p>\n<p><code>WP_Query</code> will get posts of any type (such as Pages) and can query by taxonomy terms. If you don't want to look through your plugin's code to find out what it calls the Page Tag taxonomy, in wp-admin, go to Pages &gt; Tags and look at the URL. You will have something like <code>/wp-admin/edit-tags.php?taxonomy=thetaxonomyname</code> - <code>thetaxonomyname</code> is what you're looking for. It will be <code>post_tag</code> if it's regular Core tags but could be something different depending on the plugin. Once you know for sure what your taxonomy is called, you can plug that into the <code>tax_query</code> portion of <code>WP_Query</code>.</p>\n<p>From OP's comment, the final code is</p>\n<pre><code>&lt;?php\n$pages = new WP_Query(\n array(\n 'showposts' =&gt; -1,\n 'tag' =&gt; 'thetaxonomyname',\n 'meta_key' =&gt; 'date',\n 'orderby' =&gt; 'meta_value_num',\n 'order' =&gt; 'DESC',\n 'post_type' =&gt; array( 'post', 'page' )\n \n )\n);\nprint_r($pages);\n?&gt;\n</code></pre>\n" }, { "answer_id": 412719, "author": "Giacomo1968", "author_id": 52852, "author_profile": "https://wordpress.stackexchange.com/users/52852", "pm_score": 2, "selected": true, "text": "<p>Okay, while <code>WP_Query</code> suggestion <a href=\"https://wordpress.stackexchange.com/a/412717/52852\">posted in an earlier answer</a> <em>should</em> work for me, it wasn’t working as expected.</p>\n<p>So I figured out how to do this using <code>get_posts</code> instead: Instinctively one would think to get pages one needs to use <code>get_pages</code> but (and this is the key) you can get pages via <code>get_posts</code> as well as long as <code>post_type</code> is set <code>page</code> in the arguments. I came to this conclusion when I realized that posts and pages are both stored in <code>wp_posts</code> so <code>post_type</code> should work and it indeed did work!</p>\n<p>This is what finally worked for me; just change the <code>$tag</code> value to match the tag value you want to use:</p>\n<pre><code>&lt;?php\n\n$tags = array('TheTagName');\n\n$args = array(\n 'posts_per_page' =&gt; 10,\n 'tag' =&gt; $tags,\n 'post_type' =&gt; 'page',\n 'post_status' =&gt; 'publish',\n 'post_type' =&gt; array( 'page' )\n);\n\n$query = get_posts( $args );\n\necho '&lt;ul class=&quot;page-list subpages-page-list&quot;&gt;';\nforeach ( $query as $post ) : setup_postdata( $post );\n echo sprintf('&lt;li class=&quot;page_item page-item-%d menu-item&quot;&gt;', $post-&gt;ID);\n echo &quot;&lt;a href='&quot; .$post-&gt;guid . &quot;'&gt;&quot; . $post-&gt;post_title . &quot;&lt;/a&gt;&quot;;\n echo '&lt;/li&gt;';\nendforeach;\necho '&lt;/ul&gt;';\n\nwp_reset_postdata();\n\n?&gt;\n</code></pre>\n" } ]
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>&lt;?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 function is being called too early: The wp_enqueue_script function should be called after the wp_enqueue_scripts hook is fired. Make sure that you are calling this function in the correct hook.</li>\n</ol>\n" }, { "answer_id": 412736, "author": "Mowar", "author_id": 225593, "author_profile": "https://wordpress.stackexchange.com/users/225593", "pm_score": 0, "selected": false, "text": "<p>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:\n<a href=\"https://developer.wordpress.org/reference/functions/wp_head/#comment-900\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/functions/wp_head/#comment-900</a></p>\n" } ]
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 directory.</p>\n<p>Then, add the following code to the wp-config.php file, replacing 'your-site-id' with the ID of the site you want to use the 'blogs.dir' directory for:</p>\n<pre><code>define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir/your-site-id/files' ); add_filter( 'upload_dir', 'wpse_upload_dir' ); function wpse_upload_dir( $param ) { $param['path'] = ABSPATH . UPLOADBLOGSDIR; $param['url'] = get_home_url() . '/' . UPLOADBLOGSDIR; $param['subdir'] = ''; return $param;\n</code></pre>\n" }, { "answer_id": 413175, "author": "Fayaz", "author_id": 110572, "author_profile": "https://wordpress.stackexchange.com/users/110572", "pm_score": 2, "selected": false, "text": "<p>I can see a few possibilities:</p>\n<ol>\n<li><p>Custom Uploads directory (<code>blogs.dir</code>) is not properly setup in <code>wp-config.php</code>. While <code>wp-content/uploads</code> is by default taken by WordPress, <code>wp-content/blogs.dir</code> must be setup somewhere. I don't see it in your provided code anywhere.</p>\n</li>\n<li><p>A custom directory like <code>blogs.dir</code> can be symbolically linked to <code>wp-content/uploads</code>. 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 <code>ls -alh</code> to check symlinks.</p>\n</li>\n<li><p><code>.htaccess</code> file not properly routing requests for the files located in the <code>blogs.dir</code> directory. Double-check that the <code>mod_rewrite</code> module is enabled in your Apache server and that the <code>.htaccess</code> file has the correct permissions to be read by the server.</p>\n</li>\n</ol>\n<p>Additionally, you may want to check your server's error logs for any related issues.</p>\n" } ]
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 to REST as JSON:</h3>\n<p>In the plugin or theme functions, get the meta, <code>maybe_unserialize</code> it, <code>json_encode</code> it, and add it to the REST API:</p>\n<pre><code>function add_custom_meta_to_rest( $data, $user, $context ) {\n\n // Add some check here to set a default value if the key does not exist.\n $usermeta = get_user_meta( $user-&gt;ID, 'meta_key', true );\n\n $data-&gt;data['meta']['meta_key'] = json_encode( maybe_unserialize( $usermeta ) );\n\n return $data;\n}\nadd_filter( 'rest_prepare_user', 'add_custom_meta_to_rest', 10, 3 );\n</code></pre>\n<h3>2. Get the data in your block</h3>\n<p>In your block JS file, import <code>useSelect</code> and from there you can get the data inside your <code>edit</code> function:</p>\n<pre><code>// Import `useSelect`.\nimport { useSelect } from '@wordpress/data';\n\n// Get users.\nconst users = useSelect(select =&gt; select('core').getUsers());\n\n// Get user meta from `users` and parse the JSON.\n// Be sure the user ID is set first, in this case as an attribute.\n// Also be sure to replace the meta key.\nvar userMeta = users &amp;&amp; users.length &gt; 0 &amp;&amp; users.find((user) =&gt; user.id === attributes.userId).meta.meta_key;\nuserMeta = JSON.parse(userMeta);\n</code></pre>\n<p>Test it to be sure: <code>console.log(userMeta)</code></p>\n<h3>3. FYI...</h3>\n<p>If you want, you can also get the current user:</p>\n<pre><code>const currentUser = useSelect(select =&gt; select('core').getCurrentUser());\n</code></pre>\n<p>And then set <code>userId</code> as the current user's ID if it isn't set:</p>\n<pre><code>// You'll have import `useEffect` for this:\nimport { useEffect } from '@wordpress/element';\n\n// Set userId to the current user id if it is not set.\nuseEffect(() =&gt; {\n if (!attributes.userId) {\n setAttributes({ userId: currentUser.id });\n }\n}, []);\n</code></pre>\n<p>In my case, I needed all users anyway, but you can also get a single value by user ID, as @Lovor described:</p>\n<pre><code>const userName = useSelect(select =&gt; select('core').getUser(1,{'_fields':'name'}));\nconsole.log(userName);\n</code></pre>\n<p>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:</p>\n<pre><code>if (userMeta &amp;&amp; typeof userMeta === 'object') {\n userMeta = Object.keys(userMeta).map((key) =&gt; {\n return { ...userMeta[key], id: key };\n });\n}\n</code></pre>\n<p>Hope this helps someone.</p>\n" }, { "answer_id": 413110, "author": "Lovor", "author_id": 135704, "author_profile": "https://wordpress.stackexchange.com/users/135704", "pm_score": 1, "selected": false, "text": "<p>Unfortunately, this is not documented at all. It took a while for me to get the answer by inspecting the code, and it is:</p>\n<p>in browser console you can test at first:</p>\n<pre class=\"lang-js prettyprint-override\"><code>wp.data.select('core').getUser(1,{context:'view'}) \n</code></pre>\n<p>where 1 is ID of the user.\nYou can also omit context, to get all meta data available from REST, or give <code>context: 'edit'</code>.</p>\n<p>This gives you pretty detailed object as &quot;answer&quot; whose properties are metadata.\nIf you need just certain fields, you can specify this (read REST manual, Global parameters):</p>\n<pre class=\"lang-js prettyprint-override\"><code>wp.data.select('core').getUser(1,{'_fields':'first_name,last_name'}) \n</code></pre>\n<p>From this, it is easy to refactor this to familiar form used in blocks:</p>\n<pre><code>import { useSelect } from '@wordpress/data';\n\nfunction Edit() {\nconst USER_ID = 1;\nconst user_email = useSelect(select =&gt; select('core').getUser(USER_ID, '_fields': 'email'));\n\n//some other code\n}\n</code></pre>\n<p>When trying to find solution to such questions, you can always use getEntityRecord, all others such selectors are just shortcuts to this general selector. You should inspect WP REST API Handbook and you will find your answer. Here is link to <a href=\"https://developer.wordpress.org/rest-api/reference/users/\" rel=\"nofollow noreferrer\">users</a> section</p>\n<p>When you try to find or understand some more specific but undocumented selector, you should look in Gutenberg's core-data package, <code>selectors.ts</code> or <code>entities.js</code> which dynamically injects selectors. <code>getUser</code> selector is constructed from member of array <code>rootEntitiesConfig</code> line 104 in the code (name: <code>user</code>) and it gets <code>get</code> prefix in function <code>getMethodName</code> later in code.</p>\n" } ]
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' =&gt; 'POST', 'callback' =&gt; function ( WP_REST_Request $request ) { global $wpdb; $request_body = json_decode( $request -&gt; get_body() ); $rating_table = $wpdb -&gt; prefix . &quot;rmp_analytics&quot;; $total_votes = get_post_meta( $request_body -&gt; post_id, 'rmp_vote_count', true ) ? intval( get_post_meta( $request_body -&gt; post_id, 'rmp_vote_count', true ) ) : 0; $new_votes = $total_votes + 1; $ratings_sum = get_post_meta( $request_body -&gt; post_id, 'rmp_rating_val_sum', true ) ? intval( get_post_meta( $request_body -&gt; post_id, 'rmp_rating_val_sum', true ) ) : 0; $new_ratings_sum = $ratings_sum + $request_body -&gt; vote; $new_average = round( ( $new_ratings_sum / $new_votes ), 1 ); update_post_meta( $request_body -&gt; post_id, 'rmp_vote_count', $new_votes ); update_post_meta( $request_body -&gt; post_id, 'rmp_rating_val_sum', $new_ratings_sum ); $rating_updated = $wpdb -&gt; insert( $rating_table, array( 'time' =&gt; current_time( 'mysql' ), 'ip' =&gt; '-1', 'country' =&gt; '0', 'user' =&gt; $request_body -&gt; user_id, 'post' =&gt; $request_body -&gt; post_id, 'action' =&gt; '1', 'duration' =&gt; '1', 'average' =&gt; $new_average, 'votes' =&gt; $new_votes, 'value' =&gt; $request_body -&gt; vote, 'token' =&gt; '-1', ) ); if ( $rating_updated ) : return rest_ensure_response( 'New rating registered.' ); else : return rest_ensure_response( 'Error in registering rating.' ); endif; }, 'permission_callback' =&gt; '__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_callback</code> 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 <code>manage_options</code> capability in the callback, like this:</p>\n<pre><code>register_rest_route( 'myplugin/v1', 'update-rmp'', array(\n 'permission_callback' =&gt; function () {\n return current_user_can( 'manage_options' );\n },\n) );\n</code></pre>\n<p><strong>Note:</strong> Do not use <code>wp/v2</code> as the namespace. That namespace is for endpoints registered by WordPress itself. Third party themes and plugins should use their own namespace.</p>\n<p>To make your API request as a user with the required privileges, sign in as that user and go to <em>Users &gt; Profile</em> and look for the <em>Application Passwords</em> section. Add a new application password and copy the result. You can now use this password from your application using Basic Authentication:</p>\n<pre><code>curl --user &quot;USERNAME:PASSWORD&quot; -X POST https://example.com/wp-json/myplugin/v1/update-rmp\n</code></pre>\n<p>Just substitute <code>USERNAME</code> with your WordPress username, and <code>PASSWORD</code> with the application password.</p>\n" }, { "answer_id": 412971, "author": "Mark Kaplun", "author_id": 23970, "author_profile": "https://wordpress.stackexchange.com/users/23970", "pm_score": 1, "selected": false, "text": "<p>wordpress broadcasts the available routes everywhere, and in any case hidding it is a weak security measure. Depending on how sensative the information, and how easy it is for a bad actor to wiretap the communication between the app and server you have two options</p>\n<ol>\n<li>If you just want to avoid low level attacks, use a &quot;API KEY&quot; which will identify that it is your app and not just a random &quot;postman&quot;</li>\n<li>Encript the content of the message.</li>\n</ol>\n<p>Even 2 will not do much to deter a sophisticated attacker if you store the encryption key as part of your code, and you will need to store it in a more secure storage on the app's device. You might have to have a login step and pass whatever keys in it.</p>\n<p>hmmm.... not much actually related to wordpress here, if this is very important and not just a problem that nags you for completeness of your solution, you should probably ask in security oriented sites.</p>\n" }, { "answer_id": 413067, "author": "Huxtable", "author_id": 229315, "author_profile": "https://wordpress.stackexchange.com/users/229315", "pm_score": 0, "selected": false, "text": "<pre><code>register_rest_route( 'wp/v2', 'update-rmp', array(\n 'methods' =&gt; 'POST',\n 'callback' =&gt; function ( WP_REST_Request $request ) {\n // callback logic goes here\n },\n 'permission_callback' =&gt; function () {\n $origin = get_http_origin();\n $expected_origin = 'https://example.com';\n if ( $origin === $expected_origin ) {\n return true;\n }\n return false;\n }\n) );\n</code></pre>\n<p>You can also use the is_user_logged_in() function in conjunction with a nonce to check if the user is logged in and the nonce is correct before allowing access to the route.</p>\n" } ]
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 uses the <code>init</code> hook activated on multiple sites it will work on all sites that the plugin or theme is active on.</p>\n<p>However, the hook will only run for the site that is loaded. If you load a page on Site A your callback will run and update the option on Site A, but it will not update the option on Site B until a page on Site B is loaded and the hook is run for that site.</p>\n" }, { "answer_id": 413017, "author": "Pat J", "author_id": 16121, "author_profile": "https://wordpress.stackexchange.com/users/16121", "pm_score": 2, "selected": true, "text": "<p>If your code is in a theme's <code>functions.php</code>, it'll only run on sites where that theme is active. You can ensure that it's active on <em>all</em> your sites by putting that code snippet into a <a href=\"https://developer.wordpress.org/plugins/\" rel=\"nofollow noreferrer\">plugin</a> that's active on every site (ie, Network Activated). Alternately, you can use a <a href=\"https://wordpress.org/support/article/must-use-plugins/\" rel=\"nofollow noreferrer\">Must-Use plugin</a> to ensure that it runs on every site in your Multisite network.</p>\n" } ]
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> &lt;?php // Template Name:Post By Category get_header(); ?&gt; &lt;?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' =&gt; 'postlinks', 'showposts' =&gt; -1, 'tax_query' =&gt; array( array( 'taxonomy' =&gt; 'newcategory', 'terms' =&gt; array( $category-&gt;slug ), 'field' =&gt; 'slug' ) ) ) ); ?&gt; &lt;div class=&quot; category_card-div d-lg-inline d-sm-block&quot; stylle=&quot;height:450px;&quot;&gt; &lt;div class=' p-0 text-white category_custom_card d-lg-inline-block d-sm-block' style=&quot;border: 1px solid #fff;height:450px; border-radius :15px; overflow:hidden; background:#000;width: 22%;&quot;&gt; &lt;div class='category_card_title bg-danger d-flex align-items-center justify-content-center' style='height: 80px;'&gt; &lt;h3 class='text-white text-center'&gt; &lt;?php echo $category-&gt;name; ?&gt; &lt;?php if( get_field('favicon') ): ?&gt; &lt;img class=&quot;post-icons-custom&quot; style='width: 25px; height: 25px;' src=&quot;&lt;?php echo get_the_field('favicon'); ?&gt;&quot; /&gt; &lt;?php endif; ?&gt; &lt;/h3&gt; &lt;/div&gt; &lt;ul class=&quot; custom-post-list&quot;&gt; &lt;?php while ($services-&gt;have_posts()) : $services-&gt;the_post(); ?&gt; &lt;li&gt; &lt;?php if( get_field('favicon') ): ?&gt; &lt;img class=&quot;post-icons-custom&quot; style='width: 25px; height: 25px;' src=&quot;&lt;?php the_field('favicon'); ?&gt;&quot; /&gt; &lt;?php endif; ?&gt; &lt;a class=&quot;text-white ml-2&quot; href=&quot;&lt;?php the_permalink(); ?&gt;&quot; sytle=&quot;hover:text-decoration: none;&quot;&gt; &lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;/li&gt; &lt;?php endwhile; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php // Reset things, for good measure $services = null; wp_reset_postdata(); // end the loop endforeach; ?&gt; &lt;?php get_footer(); ?&gt; </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 uses the <code>init</code> hook activated on multiple sites it will work on all sites that the plugin or theme is active on.</p>\n<p>However, the hook will only run for the site that is loaded. If you load a page on Site A your callback will run and update the option on Site A, but it will not update the option on Site B until a page on Site B is loaded and the hook is run for that site.</p>\n" }, { "answer_id": 413017, "author": "Pat J", "author_id": 16121, "author_profile": "https://wordpress.stackexchange.com/users/16121", "pm_score": 2, "selected": true, "text": "<p>If your code is in a theme's <code>functions.php</code>, it'll only run on sites where that theme is active. You can ensure that it's active on <em>all</em> your sites by putting that code snippet into a <a href=\"https://developer.wordpress.org/plugins/\" rel=\"nofollow noreferrer\">plugin</a> that's active on every site (ie, Network Activated). Alternately, you can use a <a href=\"https://wordpress.org/support/article/must-use-plugins/\" rel=\"nofollow noreferrer\">Must-Use plugin</a> to ensure that it runs on every site in your Multisite network.</p>\n" } ]
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: [![enter image description here](https://i.stack.imgur.com/bFs1r.png)](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 uses the <code>init</code> hook activated on multiple sites it will work on all sites that the plugin or theme is active on.</p>\n<p>However, the hook will only run for the site that is loaded. If you load a page on Site A your callback will run and update the option on Site A, but it will not update the option on Site B until a page on Site B is loaded and the hook is run for that site.</p>\n" }, { "answer_id": 413017, "author": "Pat J", "author_id": 16121, "author_profile": "https://wordpress.stackexchange.com/users/16121", "pm_score": 2, "selected": true, "text": "<p>If your code is in a theme's <code>functions.php</code>, it'll only run on sites where that theme is active. You can ensure that it's active on <em>all</em> your sites by putting that code snippet into a <a href=\"https://developer.wordpress.org/plugins/\" rel=\"nofollow noreferrer\">plugin</a> that's active on every site (ie, Network Activated). Alternately, you can use a <a href=\"https://wordpress.org/support/article/must-use-plugins/\" rel=\"nofollow noreferrer\">Must-Use plugin</a> to ensure that it runs on every site in your Multisite network.</p>\n" } ]
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/\" rel=\"nofollow noreferrer\"><code>plugin_dir_path()</code></a>.</p>\n<pre><code>require_once( \n plugin_dir_path( __FILE__ ) \n . 'inc/functions/single-post-ajax-callback.php' \n);\n</code></pre>\n<p>...etc.</p>\n" }, { "answer_id": 413273, "author": "slanginbits", "author_id": 229469, "author_profile": "https://wordpress.stackexchange.com/users/229469", "pm_score": 0, "selected": false, "text": "<p>I'm submitting this, so hopefully they accept it.</p>\n<pre><code>require_once( plugin_dir_path( __FILE__ ) . 'single-post-ajax-callback.php');\nrequire_once( plugin_dir_path( __FILE__ ) . 'generate-images-ajax-callback.php');\nrequire_once( plugin_dir_path( __FILE__ ) . 'add-image-to-library-ajax-callback.php');\n</code></pre>\n<p>I suppose I could have just specified a relative path such as:</p>\n<pre><code>require_once 'single-post-ajax-callback.php');\n</code></pre>\n" } ]
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 table of every site that change from 0 to 1 when user have remaining expiration date and 1 to 0 when user have no expiration date.\nwhen user have no expiration date then you have to logout that user and display popup that have information about renewal.</p>\n" }, { "answer_id": 413343, "author": "Rick Hellewell", "author_id": 29416, "author_profile": "https://wordpress.stackexchange.com/users/29416", "pm_score": 2, "selected": true, "text": "<p>Since my need is two-fold, I found these answers here with a bit more searching.</p>\n<ol>\n<li>To add to the Edit Site page, the best option is to add another 'tab' to that page. I found an answer here: <a href=\"https://wordpress.stackexchange.com/questions/103765/add-site-options-ui-in-multisite-sites-infos-page\">Add site options UI in Multisite Sites &gt; Infos page</a> , which referenced a tutorial by one of the answerers: <a href=\"https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html\" rel=\"nofollow noreferrer\">https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html</a> (tutorial updated Dec 2022).</li>\n</ol>\n<p>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.</p>\n<ol start=\"2\">\n<li>To add a column to the Sites page, I found guidance here <a href=\"https://wordpress.stackexchange.com/questions/30431/add-new-column-to-sites-page\">Add new column to sites page</a> , which referenced code on GitHub that I used as a starting point <a href=\"https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0\" rel=\"nofollow noreferrer\">https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0</a></li>\n</ol>\n<p>That code is as follows, which I modified for my needs:</p>\n<pre><code>/* Add site_name as a column */\n add_filter( 'wpmu_blogs_columns', 'add_useful_columns' );\n function add_useful_columns( $site_columns ) {\n $site_columns['site_name'] = 'Site Name';\n return $site_columns;\n }\n\n /* Populate site_name with blogs site_name */\n add_action( 'manage_sites_custom_column', 'column_site_name' , 10, 2 );\n function column_site_name( $column_name, $blog_id ) {\n $current_blog_details = get_blog_details( array( 'blog_id' =&gt; $blog_id ) );\n echo ucwords( $current_blog_details-&gt;blogname );\n }\n</code></pre>\n<p>With the above guidance, I was able to add my own settings tab, and then view settings in the Sites page.</p>\n" } ]
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 '{ &quot;source&quot;:&quot;eur&quot;, &quot;target&quot;:&quot;inr&quot; }' '''</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 table of every site that change from 0 to 1 when user have remaining expiration date and 1 to 0 when user have no expiration date.\nwhen user have no expiration date then you have to logout that user and display popup that have information about renewal.</p>\n" }, { "answer_id": 413343, "author": "Rick Hellewell", "author_id": 29416, "author_profile": "https://wordpress.stackexchange.com/users/29416", "pm_score": 2, "selected": true, "text": "<p>Since my need is two-fold, I found these answers here with a bit more searching.</p>\n<ol>\n<li>To add to the Edit Site page, the best option is to add another 'tab' to that page. I found an answer here: <a href=\"https://wordpress.stackexchange.com/questions/103765/add-site-options-ui-in-multisite-sites-infos-page\">Add site options UI in Multisite Sites &gt; Infos page</a> , which referenced a tutorial by one of the answerers: <a href=\"https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html\" rel=\"nofollow noreferrer\">https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html</a> (tutorial updated Dec 2022).</li>\n</ol>\n<p>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.</p>\n<ol start=\"2\">\n<li>To add a column to the Sites page, I found guidance here <a href=\"https://wordpress.stackexchange.com/questions/30431/add-new-column-to-sites-page\">Add new column to sites page</a> , which referenced code on GitHub that I used as a starting point <a href=\"https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0\" rel=\"nofollow noreferrer\">https://gist.github.com/yratof/1e16da7e375c0a1bc278fb46e9bcf7c0</a></li>\n</ol>\n<p>That code is as follows, which I modified for my needs:</p>\n<pre><code>/* Add site_name as a column */\n add_filter( 'wpmu_blogs_columns', 'add_useful_columns' );\n function add_useful_columns( $site_columns ) {\n $site_columns['site_name'] = 'Site Name';\n return $site_columns;\n }\n\n /* Populate site_name with blogs site_name */\n add_action( 'manage_sites_custom_column', 'column_site_name' , 10, 2 );\n function column_site_name( $column_name, $blog_id ) {\n $current_blog_details = get_blog_details( array( 'blog_id' =&gt; $blog_id ) );\n echo ucwords( $current_blog_details-&gt;blogname );\n }\n</code></pre>\n<p>With the above guidance, I was able to add my own settings tab, and then view settings in the Sites page.</p>\n" } ]
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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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&amp;apiKey=81143272da6c48d58bc38fe80dd110d6" rel="nofollow noreferrer">https://newsapi.org/v2/top-headlines?sources=techcrunch&amp;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>&lt;?php /** * Plugin Name: Automatic News Feed Importer * Version: 1.0.0 */ function news_importer() { $url = &quot;https://newsapi.org/v2/top-headlines?sources=techcrunch&amp;apiKey=81143272da6c48d58bc38fe80dd110d6&quot;; $response = wp_remote_get( $url ); $data = json_decode( wp_remote_retrieve_body( $response ) ); foreach( $data-&gt;articles as $news ) { $post_title = $news-&gt;title; $post_content = $news-&gt;content; $post_date = $news-&gt;publishedAt; $post = array( 'post_title' =&gt; $post_title, 'post_content' =&gt; $post_content, 'post_date' =&gt; $post_date, 'post_status' =&gt; 'publish', 'post_type' =&gt; '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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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 &quot;my account&quot; 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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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-&gt;term_id; GFCommon::send_email( 'a@b.com', 'a@b.com','','','New Post', $spkr_id); // update_field( 'speaker_institution', $spkr_inst, 'speaker_'.$talk_speaker-&gt;term_id); // update_field( 'speaker_phone_number', $spkr_ph, 'speaker_'.$talk_speaker-&gt;term_id); // update_field( 'speaker_email_address', $spkr_em, 'speaker_'.$talk_speaker-&gt;term_id); } } </code></pre> <p>The commented out update_field stuff NEVER happens, whether I'm using <code>'speaker_'.$talk_speaker-&gt;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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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 &quot;jobs&quot;, 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' =&gt; array( 'slug' =&gt; '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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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 manually is easy - the hard part to manage manually is the login and everything that comes with that (i.e. forgotten passwords, verifying email addresses etc. it's no easy feat!),</p>\n<p>Custom fields for Ultimate Member are in the usermeta database table</p>\n" }, { "answer_id": 413554, "author": "Glenn Mason", "author_id": 181217, "author_profile": "https://wordpress.stackexchange.com/users/181217", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n<p>For example, the form:</p>\n<pre><code>&lt;form action=&quot;&lt;?php echo esc_url( admin_url('admin-post.php') ); ?&gt;&quot; method=&quot;post&quot;&gt;\n &lt;!-- TODO: add a nonce in here --&gt;\n\n &lt;!-- this &quot;action&quot; pipes it through to the correct place --&gt;\n &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;custom_registration&quot;&gt; \n\n &lt;input type=&quot;text&quot; name=&quot;username&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;\n &lt;input type=&quot;text&quot; name=&quot;institute&quot; /&gt;\n &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;\n\n &lt;input type=&quot;submit&quot; value=&quot;Register&quot; /&gt;\n\n&lt;/form&gt;\n</code></pre>\n<p>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.</p>\n<p>Then in your functions.php file to receive the form you make a hook using <code>add_action()</code>, where the first parameter uses the format <code>admin_post_nopriv_</code>+[action]. The <code>nopriv</code> 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)</p>\n<p>This [action] needs to match the value of the hidden action field in our HTML form. Since we called it <code>custom_registration</code> then the hook would be <code>admin_post_nopriv_custom_registration</code>:</p>\n<pre><code>add_action( 'admin_post_nopriv_custom_registration', 'custom_make_new_user' ); // the format here is &quot;admin_post_nopriv_&quot; + [the hidden action you put in the html form]\n\n\nfunction custom_make_new_user(){\n\n // TODO: validate the nonce before continuing\n\n // TODO: validate that all incoming POST data is OK\n\n $user = $_POST['username']; // potentially sanitize these\n $pass = $_POST['password']; // potentially sanitize these\n $email = $_POST['email']; // potentially sanitize these\n $institute = $_POST['institute']; // potentially sanitize these\n\n $user_id = wp_create_user( $user, $pass, $email ); // this creates the new user and returns the ID\n\n if($user_id){ // if the user exists/if creating was successful.\n $user = new WP_User( $user_id ); // load the new user\n\n $user-&gt;set_role('subscriber'); // give the new user a role, in this case a subscriber\n\n // now add your custom user meta for each data point\n update_user_meta($user_id, 'institute', $institute);\n\n wp_redirect('/thank-you'); // redirect to some sort of thank you page perhaps.\n }else{\n // user wasn't made\n }\n}\n</code></pre>\n<p>That should do the trick. You could add any other user data you wanted by adding extra <code>update_user_meta();</code> - the first param is the user_id, second param is the meta_key, third param is the meta value. The neat thing about <code>update_user_meta()</code> is that if it didn't exist already it will make it, otherwise it will update an existing value.</p>\n<p>Then to retrieve this data anywhere, you would write this:</p>\n<pre><code>$user_institute = get_user_meta($user_id, 'institute', true);\n</code></pre>\n<p>The third parameter of <code>get_user_meta</code> 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.</p>\n<p>Hope that helps!</p>\n" } ]
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-&gt;input_attrs()</code> And I want to be able to use the function multiple times...</p> <p>Example 1:</p> <p><code>&lt;input type=&quot;text&quot; value=&quot;blah1&quot; &lt;?php $this-&gt;input_attrs($1); ?&gt;&gt;</code></p> <p><code>&lt;input type=&quot;text&quot; value=&quot;blah2&quot; &lt;?php $this-&gt;input_attrs($2); ?&gt;&gt;</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>&lt;input type=&quot;text&quot; value=&quot;blah1&quot; &lt;?php $this-&gt;input_attrs(); ?&gt;&gt;</code></p> <p><code>&lt;input type=&quot;text&quot; value=&quot;blah2&quot; &lt;?php $this-&gt;input_attrs_2(); ?&gt;&gt;</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://developer.wordpress.org/reference/classes/wp_customize_manager/add_control/\" rel=\"nofollow noreferrer\">add_control()</a> method of the wordpress customizer object to generate the html inputs for your customizer settings. The <code>add_control()</code> 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, &lt;select&gt;, etc.), and more. A complete list of properties you can set via the second argument of add_control() can be found <a href=\"https://developer.wordpress.org/reference/classes/wp_customize_control/__construct/\" rel=\"nofollow noreferrer\">here</a>. One of them is <code>input_attrs</code>. If you pass this property an array of name/value pairs, <code>add_control()</code> will include them as custom attributes and values on the html inputs it generates.</p>\n<p>As a loose example of what this might look like when you put it all together:</p>\n<pre><code>add_action( 'customize_register', 'mytheme_customize_register');\n\nfunction mytheme_customize_register( $wp_customize ) {\n \n $wp_customize-&gt;add_setting( 'mytheme_mysetting', array(\n 'default' =&gt; '',\n 'sanitize_callback' =&gt; 'sanitize_text_field'\n ) );\n \n $wp_customize-&gt;add_control( 'mytheme_mysetting', array(\n 'label' =&gt; __( 'My website user of the month', 'mytheme-textdomain' ),\n 'type' =&gt; 'text',\n 'section' =&gt; 'mysection',\n 'input_attrs' =&gt; array(\n 'my-custom-attribute-name' =&gt; 'my custom attribute value',\n 'foo' =&gt; 'bar'\n )\n ));\n}\n</code></pre>\n" }, { "answer_id": 413707, "author": "Angel Hess", "author_id": 210387, "author_profile": "https://wordpress.stackexchange.com/users/210387", "pm_score": 0, "selected": false, "text": "<p>In case anyone reads my question and wants an answer. To reproduce <code>input_attrs()</code> as many times as you want in a crude way all you need to do is define a variable each time in the class. For example <code>public $inputattrs2</code> and then you are able to use the code <code>echo esc_attr($this-&gt;inputattrs2);</code> or <code>echo $this-&gt;inputattrs2;</code> along with your html in your class control and the add_control. This works for anything including text descriptions or html attributes.</p>\n" } ]
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' =&gt; 'tour_category', 'hide_empty' =&gt; 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 ' &lt;a class=&quot;demo_cat_link&quot; href=&quot;#' . $term-&gt;slug . '&quot;&gt;' . $term-&gt;name . '&lt;li class=&quot;demo_cat&quot;&gt;&lt;/li&gt;&lt;/a&gt;'; } </code></pre> <p><strong>then I display the categories on the left</strong></p> <pre><code> $i = 0; foreach ($terms as $terms =&gt; $term) { $i++ != 0 ? $fClass = &quot;fade&quot; : $fClass = &quot;&quot; ; $cat_id = $term-&gt;term_id; $cat_video = get_field('featured_video', $term-&gt;taxonomy . '_' . $term-&gt;term_id ); $cat_order = get_field('tour_category_list_order', $term-&gt;taxonomy . '_' . $term-&gt;term_id ); &lt;div class=&quot;loop_left_section&quot;&gt; &lt;div class=&quot;tour_cat_thumb &lt;?=$fClass?&gt;&quot;&gt; &lt;video class=&quot;demo_featured&quot; width=&quot;620&quot; autoplay=&quot;autoplay&quot; loop=&quot;loop&quot; muted=&quot;&quot;&gt; &lt;source type=&quot;video/mp4&quot; src=&quot;&lt;?php echo $cat_video; ?&gt;&quot;&gt; &lt;/video&gt; &lt;/div&gt; &lt;? // tour_cat_thumb ?&gt; &lt;h2&gt;&lt;?php echo $term-&gt;name; ?&gt;&lt;/h2&gt; &lt;p&gt;&lt;?php echo $term-&gt;description; ?&gt;&lt;/p&gt; &lt;/div&gt; &lt;? // loop_left_section ?&gt; </code></pre> <p><strong>and the demo tours on the right</strong></p> <pre><code>&lt;div class=&quot;loop_right_section&quot;&gt; &lt;?php $args = array( 'post_type' =&gt; 'demotours', 'tax_query' =&gt; array( array( 'taxonomy' =&gt; 'tour_category', 'field' =&gt; 'slug', 'terms' =&gt; $term-&gt;slug, ), ), ); $loop = new WP_Query($args); if($loop-&gt;have_posts()) { while($loop-&gt;have_posts()) : $loop-&gt;the_post(); $demo_tour_link = ( get_field('demo_tour_link', get_the_ID() ) ? get_field('demo_tour_link', get_the_ID() ) : &quot;#&quot; ); echo '&lt;a href=&quot;'.$demo_tour_link.'&quot; class=&quot;tour_link&quot;&gt; &lt;div class=&quot;demo_tour_wrap&quot;&gt; &lt;h3&gt;' . get_the_title() . '&lt;/h3&gt; &lt;p&gt;'. get_the_excerpt() . '&lt;/p&gt; &lt;/div&gt; &lt;/a&gt;'; endwhile; } ?&gt; &lt;/div&gt; &lt;? // loop_right_section ?&gt; </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 not being able to figure it out myself.</p>\n<p>First we need a function to 'insert' our custom taxonomy custom field to our WP Object. In this case the CPT is 'tour_category' and the Custom Field is 'order_number'</p>\n<pre><code>function terms()\n {\n return array_map(function($term) {\n $term-&gt;order_number = get_field('order_number', $term);\n return $term;\n }, get_terms([\n 'taxonomy' =&gt; 'tour_category',\n 'orderby'=&gt; 'order_number',\n 'order' =&gt; 'DESC'\n ]));\n }\n</code></pre>\n<p>then, we use it in our loop:</p>\n<pre><code>$my= terms();\n$num = array_column($my, 'order_number');\narray_multisort($num, SORT_ASC, $my);\n\nforeach($my as $term) { .... } \n</code></pre>\n" }, { "answer_id": 413771, "author": "Tom J Nowell", "author_id": 736, "author_profile": "https://wordpress.stackexchange.com/users/736", "pm_score": 1, "selected": false, "text": "<p>Use <code>usort</code> with a custom callback, like this:</p>\n<pre class=\"lang-php prettyprint-override\"><code>function compare_term_order_numbers( \\WP_Term $a, \\WP_Term $b ) : int {\n $order_number_a = get_field( 'order_number', $a );\n $order_number_b = get_field( 'order_number', $b );\n return strcmp( $order_number_a, $order_number_b );\n}\n\nusort($terms, 'compare_terms' );\n</code></pre>\n<p>Note that this assumes <code>get_field</code> returns a plain string, not an object, that each term has the <code>order_number</code> set and it isn't empty, and that <code>$terms</code> is an array of terms, not an error object or <code>false</code>/<code>null</code>.</p>\n<p>More information at: <a href=\"https://www.php.net/manual/en/function.usort.php\" rel=\"nofollow noreferrer\">https://www.php.net/manual/en/function.usort.php</a></p>\n" } ]
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>\n<pre><code> var $j = jQuery.noConflict();\n \n $j(function() {\n //remove link from top-level menu items\n $j('ul.wp-block-page-list li.has-child &gt; a').removeAttr('href');\n });\n</code></pre>\n" }, { "answer_id": 413858, "author": "Peter", "author_id": 65993, "author_profile": "https://wordpress.stackexchange.com/users/65993", "pm_score": 2, "selected": false, "text": "<p>The new FSE editor uses a new filter, if you want to hook into that you can do it in two ways:</p>\n<p>By hooking the individual block rendering:</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_filter( 'render_block_core/navigation-link', 'test_render_navigation_link', 10, 3);\n\nfunction test_render_navigation_link($block_content, $block) {\n $attributes = $block[&quot;attrs&quot;];\n \n // string replace the href if you want, by checking the content of $attributes\n return $block_content;\n}\n</code></pre>\n<p>or by hooking the prerender for the entire navigational menu:</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_filter( 'block_core_navigation_render_inner_blocks', 'replace_nav_blockitem_href');\n\nfunction replace_nav_blockitem_href( $items ) {\n \n // Loop through the items (they are nested)\n foreach ($items as $key =&gt; $item) {\n //recursive loop through $item-&gt;inner_blocks\n //once you have found your item then set the attribute url to empty\n $item-&gt;parsed_block[&quot;attrs&quot;][&quot;url&quot;] = null;\n }\n return $items;\n}\n</code></pre>\n<p>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:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173</a></p>\n<p>This is the line where the first filter is called:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306</a></p>\n<p>This is the line where the second filter is called:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512</a></p>\n" } ]
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>\n<pre><code> var $j = jQuery.noConflict();\n \n $j(function() {\n //remove link from top-level menu items\n $j('ul.wp-block-page-list li.has-child &gt; a').removeAttr('href');\n });\n</code></pre>\n" }, { "answer_id": 413858, "author": "Peter", "author_id": 65993, "author_profile": "https://wordpress.stackexchange.com/users/65993", "pm_score": 2, "selected": false, "text": "<p>The new FSE editor uses a new filter, if you want to hook into that you can do it in two ways:</p>\n<p>By hooking the individual block rendering:</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_filter( 'render_block_core/navigation-link', 'test_render_navigation_link', 10, 3);\n\nfunction test_render_navigation_link($block_content, $block) {\n $attributes = $block[&quot;attrs&quot;];\n \n // string replace the href if you want, by checking the content of $attributes\n return $block_content;\n}\n</code></pre>\n<p>or by hooking the prerender for the entire navigational menu:</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_filter( 'block_core_navigation_render_inner_blocks', 'replace_nav_blockitem_href');\n\nfunction replace_nav_blockitem_href( $items ) {\n \n // Loop through the items (they are nested)\n foreach ($items as $key =&gt; $item) {\n //recursive loop through $item-&gt;inner_blocks\n //once you have found your item then set the attribute url to empty\n $item-&gt;parsed_block[&quot;attrs&quot;][&quot;url&quot;] = null;\n }\n return $items;\n}\n</code></pre>\n<p>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:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation-link.php#L173</a></p>\n<p>This is the line where the first filter is called:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/28f10e4af559c9b4dbbd1768feff0bae575d5e78/src/wp-includes/class-wp-block.php#L306</a></p>\n<p>This is the line where the second filter is called:\n<a href=\"https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512\" rel=\"nofollow noreferrer\">https://github.com/WordPress/wordpress-develop/blob/0cb8475c0d07d23893b1d73d755eda5f12024585/src/wp-includes/blocks/navigation.php#L512</a></p>\n" } ]
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 &quot;First Name + ' ' + Last Name&quot;.</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 &quot;Array Array&quot;.</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'=&gt;$post_id, 'post_title'=&gt;$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</code> which <em>returns an array</em>, and thus you got <code>Array Array</code> because you did not set that parameter (to <code>true</code>).</p>\n<p>Additionally, you incorrectly used <code>get_metadata()</code> and received either an <strong>empty array</strong> or an array of <strong>all metadata</strong> (<code>first_name</code>, <code>last_name</code>, etc.) for the specific post. See the documentation for the correct syntax, where the 1st parameter is actually the meta <strong>type</strong> and not the meta key/name:</p>\n<p><a href=\"https://developer.wordpress.org/reference/functions/get_metadata/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/functions/get_metadata/</a></p>\n<p>So in your case, the meta type is <code>post</code>, and the correct syntax is:</p>\n<pre class=\"lang-php prettyprint-override\"><code>$first = get_metadata( 'post', $post_id, 'first_name', true );\n$last = get_metadata( 'post', $post_id, 'last_name', true );\n</code></pre>\n" }, { "answer_id": 413861, "author": "techshqq", "author_id": 201170, "author_profile": "https://wordpress.stackexchange.com/users/201170", "pm_score": 2, "selected": true, "text": "<p>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 &quot;Array Array&quot; title.</p>\n<p>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:</p>\n<pre><code>$first = get_post_meta( $post_id, 'first_name', true ); //meta for first name\n$last = get_post_meta( $post_id, 'last_name', true ); //meta for last name\n</code></pre>\n<p>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.</p>\n<p>Here's the updated code:</p>\n<pre><code>add_filter( 'save_post_practitioners', 'hexagon_practitioner_set_title', \n10, 3 );\nfunction hexagon_practitioner_set_title ( $post_id, $post, $update ){\n//This temporarily removes filter to prevent infinite loops\nremove_filter( 'save_post_practitioners', __FUNCTION__ );\n\n//get first and last name meta\n$first = get_post_meta( $post_id, 'first_name', true ); //meta for first \nname\n$last = get_post_meta( $post_id, 'last_name', true ); //meta for last \nname\n\n$title = $first . ' ' . $last;\n\n//update title\nwp_update_post( array( 'ID'=&gt;$post_id, 'post_title'=&gt;$title ) );\n\n//redo filter\nadd_filter( 'save_post_practitioners', __FUNCTION__, 10, 3 );\n}\n</code></pre>\n<p>This should set the post title to &quot;First Name Last Name&quot; as you intended.</p>\n" } ]
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 &quot;form&quot; 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>&lt;CssBaseline /&gt;</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 code included via <code>admin_enqueue_scripts</code>\n<a href=\"https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/</a></p>\n<p>I put my object inside div, with custom name, and then I referred to for example input like this:</p>\n<pre><code>&lt;div class=&quot;my_div&quot;&gt;\n &lt;form class=&quot;my_div__form&quot;&gt;\n &lt;input type=&quot;text&quot; class=&quot;my_div__input&quot; /&gt;\n &lt;/form&gt;\n&lt;/div&gt;\n</code></pre>\n<p>and with that code I used this CSS:</p>\n<pre><code>.my_div .my_div__input {\n // Styles here\n}\n</code></pre>\n<p>I used BEM formatting and SCSS, but this is not relevant, and you can achieve this without those.</p>\n<p>If you do not have power over structure of the elements, I'm not sure if this is possible without !important, at least I was not able to find other solution.</p>\n" }, { "answer_id": 413902, "author": "Jacob Peattie", "author_id": 39152, "author_profile": "https://wordpress.stackexchange.com/users/39152", "pm_score": 2, "selected": true, "text": "<p>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.</p>\n<p>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.</p>\n<blockquote>\n<p>Is there a way to make the MUI inline styles take precedense over\nload-styles.php?</p>\n</blockquote>\n<p>The styles in your screenshot are inline styles, so they are already loading after <code>load-styles.php</code>. The reason they're not taking precedence is because the load-styles.php rules have a higher <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity\" rel=\"nofollow noreferrer\">specificity</a>.</p>\n<p>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.</p>\n<blockquote>\n<p>If not, is there a way to disable parts of the load-styles.php ?</p>\n</blockquote>\n<p><code>load-styles.php</code> is just outputting all the styles that have been enqueued with <code>wp_enqeueue_style()</code> in the admin. You can dequeue them with <a href=\"https://developer.wordpress.org/reference/functions/wp_dequeue_style/\" rel=\"nofollow noreferrer\"><code>wp_dequeue_style()</code></a> but you'll need to know the handle used to register the style. Tools like <a href=\"https://en-au.wordpress.org/plugins/query-monitor/\" rel=\"nofollow noreferrer\">Query Monitor</a> can give you a list of what stylesheets are enqueued, and their handles.</p>\n<p>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.</p>\n<blockquote>\n<p>If not, how do I style the admin area using React MUI?</p>\n</blockquote>\n<p>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:</p>\n<ol>\n<li>Increase the specificity of MUI selectors, if that's even possible.</li>\n<li>Add your own stylesheet that corrects any broken visuals caused by the conflict. If MUI uses dynamically generated class names, this will be difficult.</li>\n</ol>\n" } ]
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: [![enter image description here](https://i.stack.imgur.com/p7QXC.png)](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&amp;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]&amp;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 code included via <code>admin_enqueue_scripts</code>\n<a href=\"https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/</a></p>\n<p>I put my object inside div, with custom name, and then I referred to for example input like this:</p>\n<pre><code>&lt;div class=&quot;my_div&quot;&gt;\n &lt;form class=&quot;my_div__form&quot;&gt;\n &lt;input type=&quot;text&quot; class=&quot;my_div__input&quot; /&gt;\n &lt;/form&gt;\n&lt;/div&gt;\n</code></pre>\n<p>and with that code I used this CSS:</p>\n<pre><code>.my_div .my_div__input {\n // Styles here\n}\n</code></pre>\n<p>I used BEM formatting and SCSS, but this is not relevant, and you can achieve this without those.</p>\n<p>If you do not have power over structure of the elements, I'm not sure if this is possible without !important, at least I was not able to find other solution.</p>\n" }, { "answer_id": 413902, "author": "Jacob Peattie", "author_id": 39152, "author_profile": "https://wordpress.stackexchange.com/users/39152", "pm_score": 2, "selected": true, "text": "<p>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.</p>\n<p>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.</p>\n<blockquote>\n<p>Is there a way to make the MUI inline styles take precedense over\nload-styles.php?</p>\n</blockquote>\n<p>The styles in your screenshot are inline styles, so they are already loading after <code>load-styles.php</code>. The reason they're not taking precedence is because the load-styles.php rules have a higher <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity\" rel=\"nofollow noreferrer\">specificity</a>.</p>\n<p>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.</p>\n<blockquote>\n<p>If not, is there a way to disable parts of the load-styles.php ?</p>\n</blockquote>\n<p><code>load-styles.php</code> is just outputting all the styles that have been enqueued with <code>wp_enqeueue_style()</code> in the admin. You can dequeue them with <a href=\"https://developer.wordpress.org/reference/functions/wp_dequeue_style/\" rel=\"nofollow noreferrer\"><code>wp_dequeue_style()</code></a> but you'll need to know the handle used to register the style. Tools like <a href=\"https://en-au.wordpress.org/plugins/query-monitor/\" rel=\"nofollow noreferrer\">Query Monitor</a> can give you a list of what stylesheets are enqueued, and their handles.</p>\n<p>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.</p>\n<blockquote>\n<p>If not, how do I style the admin area using React MUI?</p>\n</blockquote>\n<p>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:</p>\n<ol>\n<li>Increase the specificity of MUI selectors, if that's even possible.</li>\n<li>Add your own stylesheet that corrects any broken visuals caused by the conflict. If MUI uses dynamically generated class names, this will be difficult.</li>\n</ol>\n" } ]
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-&gt;is_main_query() || is_admin() ) return; $taxquery = array( array( 'taxonomy' =&gt; 'mygroup', 'field' =&gt; 'slug', 'terms' =&gt; 'matchedstring', 'compare'=&gt; 'IN' ) ); $query-&gt;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-&gt;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-&gt;is_main_query() || is_admin() ) return; // Get posts with matched taxonomy + posts without taxonomy $queryAparams = array( 'posts_per_page' =&gt; -1, 'post_type' =&gt; 'product', 'order_by' =&gt; 'menu_order', 'order' =&gt; 'ASC', 'fields' =&gt; 'ids', 'tax_query'=&gt; array( 'relation' =&gt; 'OR', array( 'taxonomy' =&gt; 'pa_group', 'field' =&gt; 'slug', 'terms' =&gt; 'matchedstring', 'operator' =&gt; 'IN' ), array( 'taxonomy' =&gt; 'pa_group', 'operator' =&gt; 'NOT EXISTS' ) ) ); // Get posts with other taxonomies $queryBparams = array( 'posts_per_page' =&gt; -1, 'post_type' =&gt; 'product', 'order_by' =&gt; 'menu_order', 'order' =&gt; 'ASC', 'fields' =&gt; 'ids', 'tax_query'=&gt; array( 'relation' =&gt; 'AND', array( 'taxonomy' =&gt; 'pa_group', 'field' =&gt; 'slug', 'terms' =&gt; 'matchedstring', 'operator' =&gt; 'NOT IN' ), array( 'taxonomy' =&gt; 'pa_group', 'operator' =&gt; 'EXISTS' ) ) ); $queryA = new WP_Query($queryAparams); $queryB = new WP_Query($queryBparams); // Merging ids $postIDs = array_merge($queryA-&gt;posts,$queryB-&gt;posts); if(!empty($postIDs)){ $query-&gt;set('post__in', $postIDs); $query-&gt;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' =&gt; '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 matches any post that does not have the <code>matched string</code> value in the meta array.</p>\n<p>See <a href=\"https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters\" rel=\"nofollow noreferrer\">Taxonomy Parameters.</a></p>\n<p><strong>EDIT: Thank you for pointing that out, Tom. You're correct, I've updated to reflect.</strong></p>\n<pre class=\"lang-php prettyprint-override\"><code>function group_matched_posts_at_top( $query ) {\n\n// Check if this is the main query and not in the admin area\nif( !$query-&gt;is_main_query() || is_admin() )\n return;\n\n// Define the tax query with two clauses (matched and not matched)\n$taxquery = array(\n 'relation' =&gt; 'OR', // Set the relation to OR to include posts that match either clause\n array(\n 'taxonomy' =&gt; 'mymeta',\n 'field' =&gt; 'slug',\n 'terms' =&gt; 'matchedstring',\n 'operator' =&gt; 'IN' // use the operator parameter to specify the comparison operator\n ),\n array(\n 'taxonomy' =&gt; 'mymeta',\n 'field' =&gt; 'slug',\n 'terms' =&gt; 'matchedstring',\n 'operator' =&gt; 'NOT IN' // use the operator parameter to specify the comparison operator\n )\n);\n\n// Set the tax query and meta key parameters for the query\n$query-&gt;set( 'tax_query', $taxquery );\n$query-&gt;set( 'meta_key', 'mymeta' );\n\n// Set the orderby parameter to sort by the value of the &quot;mymeta&quot; field in descending order (so that matched posts appear first), and then by date in descending order (so that the most recent posts appear first within each group).\n$query-&gt;set( 'orderby', array( 'meta_value' =&gt; 'DESC', 'date' =&gt; 'DESC' ) );\n\n\nadd_action( 'pre_get_posts', 'group_matched_posts_at_top' );\n</code></pre>\n<p>The main changes are as follows:</p>\n<ul>\n<li><p>I've used the &quot;taxonomy&quot; parameter to specify the taxonomy to query.</p>\n</li>\n<li><p>I've used the &quot;operator&quot; parameter instead of &quot;compare&quot; to specify the comparison operator (IN or NOT IN).</p>\n</li>\n<li><p>I've added the &quot;field&quot; parameter with a value of &quot;slug&quot; to specify that we're comparing the term slug (i.e., the term's &quot;mymeta&quot; field).</p>\n</li>\n</ul>\n<p>These changes should make the query work with a term/taxonomy meta field, which was not supported by my earlier solution.</p>\n" }, { "answer_id": 414030, "author": "mikmikmik", "author_id": 220436, "author_profile": "https://wordpress.stackexchange.com/users/220436", "pm_score": 1, "selected": true, "text": "<p>I finally managed to do it by merging 2 queries.\nI'm using it with a woocommerce attribute but it can work with any taxonomy.</p>\n<pre><code>function group_matched_posts_at_top( $query ) {\n\n // Modify the query only if it's the main query and it's a product archive page\n if ( !$query-&gt;is_main_query() || !(is_product_category() || is_shop()) || is_admin() ) {\n return;\n }\n\n // String to match\n $string_to_match = 'Whatever taxonomy';\n\n // Query for products with matched taxonomy\n $query1 = new WP_Query( array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; -1,\n 'post_status' =&gt; 'publish',\n 'order_by' =&gt; 'menu_order',\n 'order' =&gt; 'ASC',\n 'tax_query'=&gt; array(\n 'relation' =&gt; 'OR',\n array(\n 'taxonomy' =&gt; 'pa_group',\n 'field' =&gt; 'name',\n 'terms' =&gt; $string_to_match,\n 'operator' =&gt; 'IN'\n ),\n array(\n 'taxonomy' =&gt; 'pa_group',\n 'operator' =&gt; 'NOT EXISTS'\n )\n )\n ) );\n \n // Sorting first query before merging\n usort( $query1-&gt;posts, function( $a, $b ) {\n return $a-&gt;menu_order - $b-&gt;menu_order;\n } );\n\n // Query for other products\n $query2 = new WP_Query( array(\n 'post_type' =&gt; 'product',\n 'posts_per_page' =&gt; -1,\n 'post_status' =&gt; 'publish',\n 'order_by' =&gt; 'menu_order',\n 'order' =&gt; 'ASC',\n 'tax_query'=&gt; array(\n 'relation' =&gt; 'AND',\n array(\n 'taxonomy' =&gt; 'pa_group',\n 'field' =&gt; 'name',\n 'terms' =&gt; $string_to_match,\n 'operator' =&gt; 'NOT IN'\n ),\n array(\n 'taxonomy' =&gt; 'pa_group',\n 'operator' =&gt; 'EXISTS'\n )\n )\n ) );\n\n // Sorting second query before merging\n usort( $query2-&gt;posts, function( $a, $b ) {\n return $a-&gt;menu_order - $b-&gt;menu_order;\n } );\n\n // Merge the results in the desired order\n $products = array_merge( $query1-&gt;posts, $query2-&gt;posts );\n\n // Set the modified query results\n $query-&gt;set( 'posts_per_page', -1 );\n $query-&gt;set( 'post__in', wp_list_pluck( $products, 'ID' ) );\n // keep the order\n $query-&gt;set( 'orderby', 'post__in' );\n}\n\nadd_action( 'pre_get_posts', 'group_matched_posts_at_top' );\n</code></pre>\n" } ]
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-&gt;sconfig= ['post_type'=&gt; 'event', 'slug'=&gt;'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') &amp;&amp; DOING_AUTOSAVE) { return $postData; } if (array_key_exists('post_type', $postData) &amp;&amp; $postData['post_type'] === $this-&gt;sconfig['post_type']) { if (array_key_exists('post_status', $postData) &amp;&amp; $postData['post_status'] === 'publish') { $valstat = $this-&gt;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-&gt;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. For simplicity, I use the alert() method to show it.</p>\n<p>/location/our_custom_script.js:</p>\n<pre class=\"lang-js prettyprint-override\"><code>const queryString = window.location.search;\nconst urlParams = new URLSearchParams(queryString);\n \nif urlParams.get('message') == 99 {\n alert(&quot;Wrong Meta!&quot;); //or anything else\n}\n</code></pre>\n<p>Then we use <a href=\"https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/\" rel=\"nofollow noreferrer\">enqueue_block_editor_assets</a> hook:</p>\n<pre class=\"lang-php prettyprint-override\"><code>function our_custom_error() {\n wp_enqueue_script(\n 'our_custom_error',\n plugins_url('/location/our_custom_scripts.js', __FILE__)\n );\n}\nadd_action('enqueue_block_editor_assets', 'our_custom_error');\n</code></pre>\n<p>It's not pretty, but it works, I hope...</p>\n<p>ps: To make it similar to the real deal, I guess we can copy the original notice style. But I personally would style this kind of error in different manner than the usual notice.</p>\n" }, { "answer_id": 413967, "author": "Sally CJ", "author_id": 137402, "author_profile": "https://wordpress.stackexchange.com/users/137402", "pm_score": 2, "selected": true, "text": "<blockquote>\n<p>what I cannot understand is how to call the javascript function (file\nalready enqueued in admin) after the validation from\n<code>wp_insert_post_data</code></p>\n</blockquote>\n<p>You can use the same approach that Gutenberg uses for saving meta boxes (or custom fields), which you can <a href=\"https://github.com/WordPress/gutenberg/blob/0b5ca2239f012e676d70d5011f9f96c503cc8220/packages/edit-post/src/store/actions.js#L557-L583\" rel=\"nofollow noreferrer\">find here on GitHub</a>. It basically uses <a href=\"https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#subscribe\" rel=\"nofollow noreferrer\"><code>wp.data.subscribe()</code></a> 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 <strong>not</strong> autosaved), the meta boxes will be saved.</p>\n<p>As for the PHP part, you can just store the error in a cookie and read its value using the <a href=\"https://github.com/WordPress/wordpress-develop/blob/6.1.1/src/js/_enqueues/lib/cookies.js#L10\" rel=\"nofollow noreferrer\"><code>window.wpCookies</code> API</a>, which is a custom JavaScript cookie API written by WordPress.</p>\n<p>So for example, I used the following when testing:</p>\n<ul>\n<li>PHP: <code>setcookie( 'event8273_add_notice', 'ERROR: A test error ' . time(), 0, '/' );</code></li>\n<li>JS: <code>wpCookies.get( 'event8273_add_notice' )</code></li>\n</ul>\n<p>And for checking for and displaying the error, I used this:</p>\n<pre class=\"lang-js prettyprint-override\"><code>( () =&gt; {\n const editor = wp.data.select( 'core/editor' );\n\n // Name of the cookie which contains the error message.\n const cookieName = 'event8273_add_notice';\n\n // Set the initial state.\n let wasSavingPost = editor.isSavingPost();\n let wasAutosavingPost = editor.isAutosavingPost();\n\n wp.data.subscribe( () =&gt; {\n const isSavingPost = editor.isSavingPost();\n const isAutosavingPost = editor.isAutosavingPost();\n\n // Display the error on save completion, except for autosaves.\n const shouldDisplayNotice =\n wasSavingPost &amp;&amp;\n ! wasAutosavingPost &amp;&amp;\n ! isSavingPost &amp;&amp;\n // If its status is draft, then maybe there was an error.\n ( 'draft' === editor.getEditedPostAttribute( 'status' ) );\n\n // Save current state for next inspection.\n wasSavingPost = isSavingPost;\n wasAutosavingPost = isAutosavingPost;\n\n if ( shouldDisplayNotice ) {\n const error = wpCookies.get( cookieName );\n\n // If there was an error, display it as a notice, and then remove\n // the cookie.\n if ( error ) {\n event_save_alert( error );\n wpCookies.remove( cookieName, '/' );\n }\n }\n } );\n} )();\n</code></pre>\n<p>So just copy that and paste it into your JS file, after your custom <code>event_save_alert()</code> function.</p>\n<ul>\n<li><p>Make sure that the script's dependencies contain <code>wp-data</code>, <code>utils</code> <em>and</em> <code>wp-edit-post</code>.</p>\n</li>\n<li><p>You should also load the script only on the post editing screen for your post type. E.g.</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_action( 'enqueue_block_editor_assets', function () {\n if ( is_admin() &amp;&amp; 'event' === get_current_screen()-&gt;id ) {\n wp_enqueue_script(\n 'your-handle',\n plugins_url( 'path/to/file.js', __FILE__ ),\n array( 'wp-data', 'utils', 'wp-edit-post' )\n );\n }\n} );\n</code></pre>\n</li>\n</ul>\n" } ]
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. For simplicity, I use the alert() method to show it.</p>\n<p>/location/our_custom_script.js:</p>\n<pre class=\"lang-js prettyprint-override\"><code>const queryString = window.location.search;\nconst urlParams = new URLSearchParams(queryString);\n \nif urlParams.get('message') == 99 {\n alert(&quot;Wrong Meta!&quot;); //or anything else\n}\n</code></pre>\n<p>Then we use <a href=\"https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/\" rel=\"nofollow noreferrer\">enqueue_block_editor_assets</a> hook:</p>\n<pre class=\"lang-php prettyprint-override\"><code>function our_custom_error() {\n wp_enqueue_script(\n 'our_custom_error',\n plugins_url('/location/our_custom_scripts.js', __FILE__)\n );\n}\nadd_action('enqueue_block_editor_assets', 'our_custom_error');\n</code></pre>\n<p>It's not pretty, but it works, I hope...</p>\n<p>ps: To make it similar to the real deal, I guess we can copy the original notice style. But I personally would style this kind of error in different manner than the usual notice.</p>\n" }, { "answer_id": 413967, "author": "Sally CJ", "author_id": 137402, "author_profile": "https://wordpress.stackexchange.com/users/137402", "pm_score": 2, "selected": true, "text": "<blockquote>\n<p>what I cannot understand is how to call the javascript function (file\nalready enqueued in admin) after the validation from\n<code>wp_insert_post_data</code></p>\n</blockquote>\n<p>You can use the same approach that Gutenberg uses for saving meta boxes (or custom fields), which you can <a href=\"https://github.com/WordPress/gutenberg/blob/0b5ca2239f012e676d70d5011f9f96c503cc8220/packages/edit-post/src/store/actions.js#L557-L583\" rel=\"nofollow noreferrer\">find here on GitHub</a>. It basically uses <a href=\"https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#subscribe\" rel=\"nofollow noreferrer\"><code>wp.data.subscribe()</code></a> 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 <strong>not</strong> autosaved), the meta boxes will be saved.</p>\n<p>As for the PHP part, you can just store the error in a cookie and read its value using the <a href=\"https://github.com/WordPress/wordpress-develop/blob/6.1.1/src/js/_enqueues/lib/cookies.js#L10\" rel=\"nofollow noreferrer\"><code>window.wpCookies</code> API</a>, which is a custom JavaScript cookie API written by WordPress.</p>\n<p>So for example, I used the following when testing:</p>\n<ul>\n<li>PHP: <code>setcookie( 'event8273_add_notice', 'ERROR: A test error ' . time(), 0, '/' );</code></li>\n<li>JS: <code>wpCookies.get( 'event8273_add_notice' )</code></li>\n</ul>\n<p>And for checking for and displaying the error, I used this:</p>\n<pre class=\"lang-js prettyprint-override\"><code>( () =&gt; {\n const editor = wp.data.select( 'core/editor' );\n\n // Name of the cookie which contains the error message.\n const cookieName = 'event8273_add_notice';\n\n // Set the initial state.\n let wasSavingPost = editor.isSavingPost();\n let wasAutosavingPost = editor.isAutosavingPost();\n\n wp.data.subscribe( () =&gt; {\n const isSavingPost = editor.isSavingPost();\n const isAutosavingPost = editor.isAutosavingPost();\n\n // Display the error on save completion, except for autosaves.\n const shouldDisplayNotice =\n wasSavingPost &amp;&amp;\n ! wasAutosavingPost &amp;&amp;\n ! isSavingPost &amp;&amp;\n // If its status is draft, then maybe there was an error.\n ( 'draft' === editor.getEditedPostAttribute( 'status' ) );\n\n // Save current state for next inspection.\n wasSavingPost = isSavingPost;\n wasAutosavingPost = isAutosavingPost;\n\n if ( shouldDisplayNotice ) {\n const error = wpCookies.get( cookieName );\n\n // If there was an error, display it as a notice, and then remove\n // the cookie.\n if ( error ) {\n event_save_alert( error );\n wpCookies.remove( cookieName, '/' );\n }\n }\n } );\n} )();\n</code></pre>\n<p>So just copy that and paste it into your JS file, after your custom <code>event_save_alert()</code> function.</p>\n<ul>\n<li><p>Make sure that the script's dependencies contain <code>wp-data</code>, <code>utils</code> <em>and</em> <code>wp-edit-post</code>.</p>\n</li>\n<li><p>You should also load the script only on the post editing screen for your post type. E.g.</p>\n<pre class=\"lang-php prettyprint-override\"><code>add_action( 'enqueue_block_editor_assets', function () {\n if ( is_admin() &amp;&amp; 'event' === get_current_screen()-&gt;id ) {\n wp_enqueue_script(\n 'your-handle',\n plugins_url( 'path/to/file.js', __FILE__ ),\n array( 'wp-data', 'utils', 'wp-edit-post' )\n );\n }\n} );\n</code></pre>\n</li>\n</ul>\n" } ]
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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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() { ?&gt; &lt;meta name=&quot;description&quot; content=&quot;cococo&quot; /&gt; &lt;?php } // Does not work /* function custom_description() { return '&lt;meta name=&quot;description&quot; content=&quot;cococo&quot; /&gt;'; } */ 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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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>{ &quot;id&quot;: 239, &quot;post&quot;: 424, &quot;parent&quot;: 0, &quot;author&quot;: 1, &quot;author_name&quot;: &quot;username&quot;, &quot;author_url&quot;: &quot;&quot;, &quot;date&quot;: &quot;2023-02-20T12:43:02&quot;, &quot;date_gmt&quot;: &quot;2023-02-20T20:43:02&quot;, &quot;content&quot;: { &quot;rendered&quot;: &quot;&lt;div class=\&quot;comment_text\&quot;&gt;&lt;p&gt;here is a comment&lt;/p&gt;\n&lt;/div&gt;&quot; }, &quot;link&quot;: &quot;https://example.com/my-test-post/#comment-239&quot;, &quot;status&quot;: &quot;approved&quot;, &quot;type&quot;: &quot;comment&quot;, } </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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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 -&gt; Pages) with the name &quot;Job Offer&quot; and slug &quot;job-offer&quot;</li> <li>Set the link a <code>JobOffer</code> like <code>/job-offer?id={job_id}&amp;label={job_label}</code></li> <li>In the &quot;Job Offer&quot; 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 = &quot;The job title&quot; window.history.pushState(&quot;url_with_a_better_form&quot;); </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' =&gt; array( 'name' =&gt; 'Job Offers', 'singular_name' =&gt; 'Job Offer', ), 'public' =&gt; true, 'show_ui' =&gt; false, 'rewrite' =&gt; array( 'slug' =&gt; '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>&lt;?php get_header(); do_action('onepress_page_before_content'); // I'm working in my child theme and the parent is OnePress ?&gt; &lt;div id=&quot;content&quot; class=&quot;site-content&quot;&gt; &lt;?php onepress_breadcrumb(); ?&gt; &lt;div id=&quot;content-inside&quot; class=&quot;container &quot;&gt; &lt;div id=&quot;primary&quot; class=&quot;content-area&quot;&gt; &lt;main id=&quot;main&quot; class=&quot;site-main&quot; role=&quot;main&quot;&gt; &lt;?php while (have_posts()) : the_post(); ?&gt; &lt;?php get_template_part('template-parts/content', 'single'); ?&gt; &lt;hr class=&quot;hr&quot;&gt; &lt;?php if (is_user_logged_in() &amp;&amp; in_array('subscriber', _wp_get_current_user()-&gt;roles)) : // if ($job_apps != null &amp;&amp; count($job_apps) &gt; 0) { $tmp = array_filter($job_apps, function (JobApplication $elt) { return is_int(strpos($_SERVER['REQUEST_URI'], $elt-&gt;job-&gt;post_name)); }); if (count($tmp) &gt; 0) echo &quot;&lt;div class='mt-2 mb-3 h6'&gt;&lt;span class='alert alert-info'&gt;&quot; . do_shortcode('[icon name=&quot;circle-info&quot; prefix=&quot;fas&quot;]') . &quot; ...&lt;/span&gt;&lt;/div&gt;&quot;; } ?&gt; &lt;p class=&quot;h5 mb-3&quot;&gt;...&lt;/p&gt; &lt;?= do_shortcode('[form-job-application]') ?&gt; &lt;?php else : ?&gt; &lt;p class=&quot;h6&quot;&gt; //// &lt;?php if (!is_user_logged_in()) : ?&gt; /////// &lt;?php endif; ?&gt; &lt;/p&gt; &lt;?php endif; ?&gt; &lt;?php endwhile; ?&gt; &lt;/main&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php get_footer(); ?&gt; </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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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 &quot;posts_per_page&quot; 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' =&gt; $post_slug, 'posts_per_page' =&gt; 12, 'paged' =&gt; 1, 'post_status' =&gt; 'publish', ); $topicsHub = new WP_Query($args); &lt;?php while ( $topicsHub-&gt;have_posts() ) : $topicsHub-&gt;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 =&gt; $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; } } } ?&gt; &lt;div class=&quot;u-12 u-6@sm u-4@md resource__main-tab--item&quot;&gt; &lt;?php get_template_part('partial/content', 'topics-card'); ?&gt; &lt;/div&gt; &lt;?php endwhile; ?&gt; </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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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>&lt;?php get_header(); get_template_part('template-parts/banner','title'); ?&gt; &lt;div class=&quot;container&quot;&gt; &lt;p&gt;HERE GOES THE TEXT&lt;/p&gt; &lt;/div&gt; &lt;?php get_footer(); ?&gt; </code></pre> <p>in the page-main.php I have created a link: <code>&lt;a href=&quot;&lt;?php echo site_url('/example.php'); ?&gt;&lt;/a&gt;</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> &lt;?php while ( have_posts() ) : the_post(); ?&gt; &lt;?php the_content(); ?&gt; &lt;?php endwhile; ?&gt; </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>&lt;?php get_header(); get_template_part('template-parts/banner','title'); ?&gt; &lt;?php while ( have_posts() ) : the_post(); ?&gt; &lt;?php the_content(); ?&gt; &lt;?php endwhile; ?&gt; &lt;div class=&quot;container&quot;&gt; &lt;p&gt;HERE GOES THE TEXT&lt;/p&gt; &lt;/div&gt; &lt;?php get_footer(); ?&gt; </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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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 user avatars, which in turn retrieves the avatar URL from Gravatar. However, <code>get_avatar()</code> also applies the <code>get_avatar_url</code> filter before returning the URL, so you can modify the avatar URL for the comments by using that filter.</p>\n<p>Here's an example of how you can modify the avatar URL for comments using the <code>get_avatar_url</code> filter:</p>\n<pre><code>add_filter( 'get_avatar_url', 'my_plugin_filter_get_avatar_url', 10, 3 );\nfunction my_plugin_filter_get_avatar_url( $url, $id_or_email, $args ) {\n // Check if we are displaying a comment avatar\n if ( is_object( $args ) &amp;&amp; isset( $args-&gt;object_type ) &amp;&amp; $args-&gt;object_type === 'comment' ) {\n // Do something to modify the avatar URL for comments\n $modified_url = 'https://example.com/my-modified-avatar-url.jpg';\n return $modified_url;\n }\n // Return the original avatar URL for other cases\n return $url;\n}\n</code></pre>\n<p>In this example, we check if the <code>object_type</code> argument of the <code>$args</code> 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.</p>\n<p>Note that if you have other filters hooked to the <code>get_avatar_url</code> filter, they will also be applied to the comment avatars, so make sure your filter is compatible with other filters that may be running.</p>\n" }, { "answer_id": 414042, "author": "Thiago Santos", "author_id": 158367, "author_profile": "https://wordpress.stackexchange.com/users/158367", "pm_score": 1, "selected": false, "text": "<p>The <code>get_avatar_url</code> filter you are using only affects the avatar URL generated by the <code>get_avatar_url</code> function. The <code>wp_list_comments</code> function, on the other hand, uses the <code>get_avatar</code> function to generate the avatar HTML, which does not go through the <code>get_avatar_url</code> filter.</p>\n<p>To modify the avatar displayed in comments, you can use the <code>get_avatar_data</code> filter, which is called by the <code>get_avatar</code> function and allows you to modify the data used to generate the avatar HTML. Here's an example of how you can use it:</p>\n<pre><code>add_filter( 'get_avatar_data', 'my\\plugin\\filter_get_avatar_data', 10, 2 );\n\nfunction filter_get_avatar_data( $args, $id_or_email ) {\n // Modify the avatar data as needed\n $args['url'] = 'https://example.com/my-custom-avatar.png';\n\n return $args;\n}\n</code></pre>\n<p>In this example, the <code>get_avatar_data</code> filter is used to modify the avatar data by changing the <code>url</code> parameter to the URL of a custom avatar image. You can modify the avatar data in any way you need, and the modified data will be used to generate the avatar HTML.</p>\n<p>Note that the <code>get_avatar_data</code> filter is called with two parameters: <code>$args</code>, which is an array of arguments used to generate the avatar, and <code>$id_or_email</code>, which is the user ID or email address associated with the avatar. You can use these parameters to modify the avatar data as needed.</p>\n<p>Keep in mind that modifying the avatar HTML in comments can be tricky, as comments may be cached by WordPress or by third-party caching plugins, so your changes may not be immediately visible. Additionally, modifying the avatar data may also affect other parts of your site that use the <code>get_avatar</code> function, so be sure to test thoroughly.</p>\n<p>Reference:\n<a href=\"https://developer.wordpress.org/reference/hooks/get_avatar_data/\" rel=\"nofollow noreferrer\">https://developer.wordpress.org/reference/hooks/get_avatar_data/</a></p>\n" }, { "answer_id": 414060, "author": "Álvaro Franz", "author_id": 155394, "author_profile": "https://wordpress.stackexchange.com/users/155394", "pm_score": 0, "selected": false, "text": "<p>After researching a bit more, I found out that we can indeed get the right avatar with the filter. The problem is, the filter param <code>$id_or_email</code> accepts many values: a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.</p>\n<p>So, I had to modify the function that filters the value and make sure it also handles the case that the passed value is an instance of <em>WP_Comment</em>.</p>\n<pre><code>function filter_get_avatar_url( $url, $id_or_email ) {\n \n // If $id_or_email is a WP_User object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;ID ) ) {\n $id_or_email = $id_or_email-&gt;ID;\n }\n\n // If $id_or_email is a WP_Comment object, just get the user ID from it\n if ( is_object( $id_or_email ) &amp;&amp; isset( $id_or_email-&gt;user_id ) ) {\n $id_or_email = $id_or_email-&gt;user_id;\n }\n\n // Normalize the current user ID\n if ( is_numeric( $id_or_email ) ) {\n $user_id = $id_or_email;\n } else if ( is_string( $id_or_email ) &amp;&amp; is_email( $id_or_email ) ) {\n $user = get_user_by( 'email', $id_or_email );\n if ( empty( $user ) ) {\n return $url;\n }\n $user_id = $user-&gt;ID;\n } else {\n return $url;\n }\n\n // Get user meta avatar\n $custom_avatar_url = get_user_meta( $user_id, 'avatar', true );\n\n if ( empty( $custom_avatar_url ) ) {\n return $url;\n }\n\n return $custom_avatar_url;\n\n}\n</code></pre>\n<p>Now, it's working as expected.</p>\n" } ]
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 &quot;apple&quot; 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] =&gt; 1 [posts_per_page] =&gt; 50 [tax_query] =&gt; Array ( [0] =&gt; Array ( [taxonomy] =&gt; product_type [field] =&gt; slug [terms] =&gt; Array ( [0] =&gt; chipin ) [operator] =&gt; NOT IN ) ) [status] =&gt; publish [orderby] =&gt; date [order] =&gt; DESC [meta_query] =&gt; Array ( [0] =&gt; Array ( [key] =&gt; _stock_status [value] =&gt; instock ) [1] =&gt; Array ( [key] =&gt; post_title [value] =&gt; apple [compare] =&gt; LIKE ) [2] =&gt; Array ( [relation] =&gt; OR ) ) [title_filter] =&gt; apple [title_filter_relation] =&gt; OR [post_type] =&gt; 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' =&gt; 'product',\n 's' =&gt; 'apple',\n 'post_status' =&gt; 'publish',\n 'posts_per_page' =&gt; -1, \n);\n\n$wp_query = new WP_Query($args);\n</code></pre>\n" }, { "answer_id": 414354, "author": "nmr", "author_id": 147428, "author_profile": "https://wordpress.stackexchange.com/users/147428", "pm_score": 2, "selected": true, "text": "<p>You added <strong>title</strong> inside <code>$args['meta_query']</code> and that's why your query doesn't work.\nChecking the <a href=\"https://developer.wordpress.org/reference/classes/wp_query/parse_query/\" rel=\"nofollow noreferrer\">documentation</a> (get_posts / WP_Query) you will find the available parameters, among them <code>title</code> and <code>s</code>.</p>\n<pre><code>$args = array(\n 's' =&gt; 'apple',\n 'post_type' =&gt; 'product'\n //\n // other parameters\n // 'status`, 'orderby', 'meta_query', ...\n)\n$posts = get_posts($args);\n</code></pre>\n<p>If you use the <code>title</code> parameter - the exact match of the post title will be checked.<br />\n<code>bhs_posts.post_title = 'some text'</code></p>\n<p>If you use <code>s</code> parameter - (in simplification) the phrase will be splited and searched in the post title, content and excerpt .</p>\n<pre><code>((bhs_posts.post_title like '%some%' OR bhs_posts.post_excerpt like '%some%' OR bhs_posts.post_content like '%some%')\nAND (bhs_posts.post_title like '%text%' OR bhs_posts.post_excerpt like '%text%' OR bhs_posts.post_content like '%text%'))\n</code></pre>\n<p>If you want to <strong>search only in the title</strong> of a post, you will need to use <a href=\"https://developer.wordpress.org/reference/hooks/posts_search/\" rel=\"nofollow noreferrer\">posts_search</a> or <a href=\"https://developer.wordpress.org/reference/hooks/posts_where/\" rel=\"nofollow noreferrer\">posts_where</a> filter to modify the query.</p>\n<pre><code>add_filter('posts_search', 'se414324_title_search', 100, 2)\nfunction se414324_title_search( $search, $wp_query )\n{\n global $wpdb;\n\n $qv = &amp;$wp_query-&gt;query_vars;\n if ( !isset($qv['wpse_title_search']) || 0 == strlen($qv['wpse_title_search']) )\n return $search;\n\n $like = $wpdb-&gt;esc_like( $qv['wpse_title_search'] ) . '%';\n $search = $wpdb-&gt;prepare( &quot; AND {$wpdb-&gt;posts}.post_title LIKE %s&quot;, $like );\n return $search;\n}\n</code></pre>\n<p>To modify only selected queries, and not all performed by WP, we use our own parameter name, here <code>wpse_title_search</code> in <code>$args</code> array.</p>\n<pre><code>$args = array(\n 'wpse_title_search' =&gt; 'apple',\n 'post_type' =&gt; 'product',\n //\n // other parameters\n // 'status`, 'orderby', 'meta_query', ...\n)\n$myquery = new WP_Query($args);\n</code></pre>\n<p>OR</p>\n<pre><code>// &quot;suppress_filters&quot; is necessary for the filters to be applied\n$args = array(\n 'wpse_title_search' =&gt; 'apple',\n 'post_type' =&gt; 'product',\n 'suppress_filters' =&gt; false,\n //\n // other parameters\n // 'status`, 'orderby', 'meta_query', ...\n)\n$posts = get_posts($args);\n</code></pre>\n" } ]
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: [![enter image description here](https://i.stack.imgur.com/B8h6M.png)](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>&lt;!-- Font Awesome Icon --&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php echo get_template_directory_uri(); ?&gt;/css/all.min.css&quot; /&gt; </code></pre> <pre><code> &lt;ul class=&quot;social-icons ml-md-n2 justify-content-center justify-content-md-start&quot;&gt; &lt;li class=&quot;social-icons-linkedin&quot;&gt;&lt;a data-toggle=&quot;tooltip&quot; href=&quot;https://www.linkedin.com/in/&quot; target=&quot;_blank&quot; title=&quot;LinkedIn&quot; data-original-title=&quot;LinkedIn&quot;&gt;&lt;i class=&quot;fab fa-linkedin&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class=&quot;social-icons-github&quot;&gt;&lt;a data-toggle=&quot;tooltip&quot; href=&quot;https://github.com/&quot; target=&quot;_blank&quot; title=&quot;Github&quot; data-original-title=&quot;GitHub&quot;&gt;&lt;i class=&quot;fab fa-github&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class=&quot;social-icons-twitter&quot;&gt;&lt;a data-toggle=&quot;tooltip&quot; href=&quot;https://twitter.com/&quot; target=&quot;_blank&quot; title=&quot;Twitter&quot; data-original-title=&quot;Twitter&quot;&gt;&lt;i class=&quot;fab fa-twitter&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class=&quot;social-icons-instagram&quot;&gt;&lt;a data-toggle=&quot;tooltip&quot; href=&quot;https://instagram.com/&quot; target=&quot;_blank&quot; title=&quot;Instagram&quot; data-original-title=&quot;Instagram&quot;&gt;&lt;i class=&quot;fab fa-instagram&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </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>&lt;link rel=&quot;stylesheet&quot; href=&quot;https://kit.fontawesome.com/xxxxx.css&quot; crossorigin=&quot;anonymous&quot;&gt; &lt;script src=&quot;https://kit.fontawesome.com/xxxxxxx.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt; </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=\"nofollow noreferrer\">all.min.css</a> font is loaded onto your site, but can you please check you have a <code>webfonts</code> directory with files such as <code>fa-solid-900.woff</code> and <code>fa-solid-900.svg</code> - 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 <code>src:url(../webfonts/fa-solid-900.eot);</code></p>\n<p>The CSS class names and <code>font-family: &quot;Font Awesome 5 Free&quot;</code> look fine otherwise, so I suspect it's just a case of missing the font files (or the path being incorrect)</p>\n" }, { "answer_id": 414340, "author": "YourManDan", "author_id": 224682, "author_profile": "https://wordpress.stackexchange.com/users/224682", "pm_score": -1, "selected": false, "text": "<p>You should be using Font Awesome's provided <code>&lt;link&gt;</code> or <code>&lt;script&gt;</code> tag(s) that they give you with your kit. It should look like this:</p>\n<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;https://kit.fontawesome.com/xxxxx.css&quot; crossorigin=&quot;anonymous&quot;&gt;\n</code></pre>\n<p>or if you prefer the JS method:</p>\n<pre><code>&lt;script src=&quot;https://kit.fontawesome.com/xxxxxxx.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;\n</code></pre>\n<p>Copying and pasting the code from their CSS file to your local one isn't advisable because there are relative links to Font Awesome custom fonts that can't/won't be included in your site's files. (As @Alexander Holsgrove points out)</p>\n" } ]
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&#39;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 that situation, are perfectly on-topic for this site.</p>\n\n<p>To quote <a href=\"http://chat.stackexchange.com/transcript/message/7633749#7633749\">enderland in chat</a>:</p>\n\n<blockquote>\n <p>By definition of this site, we are going to get a lot of practical\n questions which are at core \"here's a situation. what should I do?\" or\n \"I did this. was this a good idea?\"</p>\n</blockquote>\n\n<p>The key is to make sure the question can be applied to more than just you, and that it's written in such a way that it's open to any solution, and is not solely focused on just \"getting your way\".</p>\n\n<p>For example, you can say \"How can I politely get my coworker fired\", however the answer you will most likely receive is that you're focusing on the wrong thing, and you should instead bring up concerns about your co-worker to your manager and let them handle the situation.</p>\n\n<p>Providing the question is seeking advice for a workplace situation, isn't localized to just you, and is not just seeking a polite way to have your own way in the workplace while ignoring all the other great advice that users here offer, I'd say it's fine and should be judged the same way you would judge any other on-topic question (does it contain enough detail, is it clear what is being asked, is it overly broad, etc).</p>\n" }, { "answer_id": 618, "author": "enderland", "author_id": 2322, "author_profile": "https://workplace.meta.stackexchange.com/users/2322", "pm_score": 3, "selected": false, "text": "<blockquote>\n <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>\n</blockquote>\n\n<p>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.</p>\n\n<p>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?\"</p>\n\n<p>Our FAQ contains:</p>\n\n<blockquote>\n <p>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.</p>\n</blockquote>\n\n<p>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.</p>\n\n<hr>\n\n<p>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.</p>\n\n<hr>\n\n<pre><code>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!\n</code></pre>\n" }, { "answer_id": 619, "author": "IDrinkandIKnowThings", "author_id": 16, "author_profile": "https://workplace.meta.stackexchange.com/users/16", "pm_score": 3, "selected": false, "text": "<p>How should I handle this is not constructive. A question should have a problem and an objective clearly defined. And it should be closed as not constructive.</p>\n\n<p><em>(The below is intentionally absurd and off topic)</em></p>\n\n<blockquote>\n <p>My car is on fire and there is a suitcase full of money in the back seat. What should I do?</p>\n</blockquote>\n\n<p>Grab some sticks and marshmellows... That is a perfectly valid answer to the question posed. But it should not be a valid answer to a question on The Workplace. </p>\n\n<p>We could edit the question to:</p>\n\n<blockquote>\n <p>My car is on fire and there is a suitcase full of money in the back\n seat. How do I put the fire out?</p>\n</blockquote>\n\n<p>But we do not know if that is what the OP wants. Maybe the OP just wants to save the suitcase full of money. Maybe they want to know how to prove that the money was in the back seat for insurance, or maybe they want to know how they get to california when their car burned in Kansas. We can not know and until the OP clarifies we should not attempt to edit and get it reopened(if closed).</p>\n\n<p>If a question gets edited asking for the wrong thing then the OP is not helped. Just editing a question to have another question open on the site should not be our goal. We should be trying to build a repository of questions and answers that help with real problems that people actually want solved.</p>\n\n<p>We have dealt with this before and <a href=\"https://workplace.meta.stackexchange.com/a/44/16\">This was the response from the SE Beta overseers</a></p>\n" } ]
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 &#39;community-ads&#39;" 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.com/nWWnm.png\" alt=\"Help this community grow -- follow us on twitter!\"></a></p>\n" }, { "answer_id": 2441, "author": "jmac", "author_id": 7945, "author_profile": "https://workplace.meta.stackexchange.com/users/7945", "pm_score": 3, "selected": false, "text": "<p><a href=\"https://workplace.stackexchange.com/questions/20323/\"><img src=\"https://i.stack.imgur.com/x9tUK.png\" alt=\"First job? We can help!\"></a></p>\n" }, { "answer_id": 2601, "author": "jmac", "author_id": 7945, "author_profile": "https://workplace.meta.stackexchange.com/users/7945", "pm_score": 3, "selected": false, "text": "<p><a href=\"https://workplace.meta.stackexchange.com/questions/2652/we-want-you-for-community-moderation\"><img src=\"https://i.stack.imgur.com/SAYp1.png\" alt=\"We Want You! To Make TWP Better\"></a></p>\n" }, { "answer_id": 2966, "author": "Connor", "author_id": 25154, "author_profile": "https://workplace.meta.stackexchange.com/users/25154", "pm_score": 4, "selected": false, "text": "<p><a href=\"http://startups.stackexchange.com\"><img src=\"https://i.stack.imgur.com/Qs0TF.png\" alt=\"Visit Startups.SE!\"></a></p>\n" } ]
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).
[![Visit Startups.SE!](https://i.stack.imgur.com/Qs0TF.png)](http://startups.stackexchange.com)
2,456
<p><sup><a href="http://chat.stackexchange.com/transcript/message/14393594#14393594" title="&#39;preferably @gnat or @Chad, or anyone else related to this whole hot question poor answer crusade that&#39;s been going on....&#39;">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&#39;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? Possible values: edited and notice removed, edited but insufficient (notice not removed), notice removed sans edit (successfully contested), answer deleted by owner, answer deleted by mod/community after the waiting period, answer deleted by mod/com early. Did I miss any? Or do we only care about \"fixed\" and \"gone\", without the detailed breakdown?</p></li>\n<li><p>Of the flags requesting this notice (how do we identify those?), how many were accepted (notice added) and how many dismissed? In other words, how good is the community at identifying problem answers in the first place?</p></li>\n<li><p>Maybe: how many answers are deleted (by non-owners) without going through this process. These are the ones that are considered to be unredeemable.</p></li>\n</ul>\n\n<p>Things we need to do to prepare:</p>\n\n<ul>\n<li><p>Decide how we'll collect the data. If we're going to use the Data Explorer, we need to make sure everything we'll need is queryable there. Or we could decide to do it manually (which means, in practice, mods doing it). This depends in part on how many of these we expect to have, which depends on:</p></li>\n<li><p>Decide how long to run this experiment.</p></li>\n<li><p>Build the queries we'll use to collect the data.</p></li>\n<li><p>Decide on the community workflow. By what means (what type of flag?) do community members nominate a post for a post notice, <em>within the current tool set</em>? (Need to find out, if using SEDE: is the text of custom flags available in the data explorer, or only that they were mod flags?)</p></li>\n<li><p>Decide on the moderator workflow. Moderators need to review the requests, add notices, and perhaps do something to set a reminder (which could be low-tech, like a list on meta, or developing the right query). When the waiting period is up, moderators need to either remove the notices (if the post was improved) or delete the posts (otherwise).</p></li>\n<li><p>Decide how we decide. Once a post has a notice and gets an edit, how does the community decide if it's good enough to remove the notice? Moderators shouldn't have to read minds or decide on their own. During the experiment, should we just plan to use a chat room for reaching informal consensus, or what? (We don't have the equivalent of \"reopen\" votes for answers, so there's no review-queue support here.)</p></li>\n<li><p>Decide what the waiting period is. How long do we allow for edits (or challenges) before acting on answers with notices?</p></li>\n</ul>\n\n<p>Did I miss anything?</p>\n" }, { "answer_id": 2484, "author": "jmac", "author_id": 7945, "author_profile": "https://workplace.meta.stackexchange.com/users/7945", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n\n<h2>What are we trying to find out?</h2>\n\n<p><em>\"Are post notices successful?\"</em> is the question we're trying to answer.</p>\n\n<h2>What is success?</h2>\n\n<p>This is where things get sticky, but I'd advocate the following measures of success for post notices:</p>\n\n<ol>\n<li>Post notices result in <strong>more successful edits</strong> of answers with them</li>\n<li>Post notices <strong>clearly indicate poor posts</strong> that should be deleted if not edited</li>\n</ol>\n\n<p>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.</p>\n\n<h2>How can we measure that?</h2>\n\n<p>We should gather the following information:</p>\n\n<ol>\n<li># of answers</li>\n<li># of edited answers</li>\n<li># of successful edits</li>\n<li># of edited answers deleted</li>\n<li># of non-edited answers deleted</li>\n</ol>\n\n<p>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.</p>\n\n<p>We need to compare to a baseline. I suggest comparing the following three categories:</p>\n\n<ol>\n<li>Answers with a post notice (test case)</li>\n<li>Answers with >=1 downvote, negative score, and a comment</li>\n<li>Answers with >=1 downvote, negative score</li>\n</ol>\n\n<h2>Summary</h2>\n\n<p>Get a table like this:</p>\n\n<pre><code> # answers | # edited | # successful edits | # edited/del | # non-edited/del\nPost Notice\nDV + Comment\nAll Answers\n</code></pre>\n" } ]
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&amp;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&amp;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 &#39;+1 for [something about the post]&#39; 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 &#39;comments&#39;" 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 way they do at every other site - they leave a comment. If this were happening only rarely, then it would be reasonable to blame the writer. But since this happens continuously, you must blame the interface.</p>\n\n<p>If you really want to limit this to leaving clarifying questions or suggestions for improving the Question (or Answer) - choose a more descriptive label. Don't use the word \"comment\" since that word clearly has implications that don't match the field's intent.</p>\n\n<p>Otherwise, it comes across as over-moderation, and sometimes as arbitrary moderation.</p>\n\n<p>This isn't a \"naughty user\" issue - it's a \"bad UI\" issue. It can be fixed, rather than trying to be taught.</p>\n" }, { "answer_id": 2751, "author": "Joe Strazzere", "author_id": 7777, "author_profile": "https://workplace.meta.stackexchange.com/users/7777", "pm_score": 4, "selected": false, "text": "<p>Since users appear to want to be chatty, make it easier for them to chat.</p>\n\n<p>Right now, users are forced to leave the Question/Answer UI and figure out how the chat system works. Too much work; not worth the effort for many.</p>\n\n<p>Instead, consider adding a link within the main UI, labeled something like \"Discuss this Question/Answer in more detail\" which leads the user directly to a Chat Room.</p>\n\n<p>If you make the access to chat as easy as clicking the \"add comment\" link, you'll have more chatters.</p>\n" }, { "answer_id": 2753, "author": "Jon Ericson", "author_id": 9899, "author_profile": "https://workplace.meta.stackexchange.com/users/9899", "pm_score": 5, "selected": false, "text": "<h2>Does The Workplace have a particular problem with comment volume?</h2>\n<p>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:</p>\n<pre><code>C/P Site\n--- ----\n4.08 Skeptics \n3.8 Politics \n3.06 Jewish Life and Learning\n3.06 History \n2.94 Mathematica\n2.87 Puzzling Stack Exchange\n2.81 Linguistics\n2.78 Christianity\n2.75 The Workplace\n2.72 Theoretical Computer Science\n2.63 Philosophy\n2.57 MathOverflow\n2.52 Code Golf \n</code></pre>\n<p>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.</p>\n<p>Considering the place workplace issues have on the <a href=\"http://blog.stackoverflow.com/2010/09/good-subjective-bad-subjective/\">scale of subjectivity</a>, 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 <a href=\"https://meta.mathoverflow.net/a/247/36770\">comments for collaboration</a>.) 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.</p>\n<h2>Is the problem growing?</h2>\n<p>Well, it depends on how you look at it. I've forked your query and added a couple more lines:</p>\n<p><a href=\"http://data.stackexchange.com/workplace/query/207674/comments-per-week#graph\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aH3rQ.png\" alt=\"Comment per Post\" /></a></p>\n<p>The green <code>C_per_P_100</code> 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.</p>\n<h2>Does this mean there's no comment problem?</h2>\n<p>Not at all. There are a few things I haven't looked at that might be a problem:</p>\n<ol>\n<li><p>Comment distribution</p>\n<p>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 <a href=\"https://workplace.stackexchange.com/questions/28338/how-do-you-decide-when-to-go-home-for-the-day\">How do you decide when to go home for the day?</a>) the problem can be quite noticable. For moderators especially, the automated <a href=\"https://meta.stackexchange.com/q/144694/1438\">&quot;too many comments&quot;</a> flag ensures that such posts are noticed.</p>\n</li>\n<li><p>Comment length</p>\n<p>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 <a href=\"https://meta.stackexchange.com/questions/235255/proposed-tweak-to-comment-ui-for-long-threads\">single-line comments take just one line</a>, which could further reduce the space consumed by short comments. (On the other hand, <a href=\"https://meta.stackexchange.com/questions/204402/hide-trivial-comments\">long comments tend to be higher quality</a>. See the next point.)</p>\n</li>\n<li><p>Comment quality</p>\n<p>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 <a href=\"https://workplace.meta.stackexchange.com/questions/2634/are-1-for-something-about-the-post-comments-discouraged\">+1 comments</a> 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 <em>per se</em>, is the problem here.</p>\n</li>\n</ol>\n<h2>Summary</h2>\n<p>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&amp;A site, we may need to explore aggressive corrections.</p>\n" }, { "answer_id": 2757, "author": "aroth", "author_id": 1717, "author_profile": "https://workplace.meta.stackexchange.com/users/1717", "pm_score": 5, "selected": false, "text": "<p>I second what Joe Strazzere said. Or reiterate what I said on the other post. Whichever.</p>\n\n<p>You don't have a comments problem; <strong>you have a UX problem</strong>. </p>\n\n<p>If you have to explain to people \"what [Feature X] is for\", then <strong>[Feature X] is broken</strong>. If [Feature X] is intended to be used in a way that is orthogonal to the way people intuitively use it, then <strong>[Feature X] is broken</strong>. </p>\n\n<p>Software interfaces need to be intuitive. They need to clearly convey to the user what's expected of them (graphically, without using a wall of text), and they should conform to the expectations created. Having explicit instructions/a manual is nice, but it's not reasonable/practical to expect that end-users will read and/or follow it. The acronym '<a href=\"http://en.wikipedia.org/wiki/RTFM\" rel=\"nofollow noreferrer\">RTFM</a>' exists for a reason, and that reason is not because people are good at reading or following instructions.</p>\n\n<p>So the comments problem (if there is one; as Jon Ericson <em>very correctly</em> points out the metric you want to look at is comments per post/answer, not the absolute number of comments made, and by that metric the commenting rate is holding flat) is merely a symptom of an underlying UX problem. And instead of attacking the symptom (which on a personal level I find to be very inappropriate, as I have seen a number of useful, helpful, and insightful comments get deleted under the guise of \"improving the QA site\"; and this is also <em>not</em> something I've seen happen on other SE sites), you should go after its root cause. </p>\n\n<p>As I see it, the root cause begins and propagates roughly like:</p>\n\n<ol>\n<li>You have a feature in the interface that calls itself 'add comment'.</li>\n<li>The concept of a 'comment' is <a href=\"http://dictionary.reference.com/browse/comment?s=t\" rel=\"nofollow noreferrer\">well defined</a>, both linguistically and within the web/blog/forum/general Internet context.</li>\n<li>People use the 'add comment' feature to make <a href=\"http://dictionary.reference.com/browse/comment?s=t\" rel=\"nofollow noreferrer\">comments</a>, according to their intuitive understanding of what a 'comment' is.</li>\n<li>While the comments made generally abide by the same content guidelines as questions/answers (in terms of being respectful, on topic, and not vulgar/abusive), they don't fit the <a href=\"https://workplace.meta.stackexchange.com/questions/72/what-comments-are-not\">modified definition</a> of a comment that has been adopted here.</li>\n<li>Manual action is taken to weed out all of those <a href=\"http://dictionary.reference.com/browse/comment?s=t\" rel=\"nofollow noreferrer\">comments</a> that aren't <a href=\"https://workplace.meta.stackexchange.com/questions/72/what-comments-are-not\">comments</a>.</li>\n<li><a href=\"https://workplace.meta.stackexchange.com/questions/2743/why-did-all-comments-suddenly-start-disappearing\">Frustration ensues</a>, on <a href=\"https://workplace.meta.stackexchange.com/questions/2691/get-a-room-a-chat-room\">all sides</a>.</li>\n</ol>\n\n<p>Item #1 is the root of the issue. As long as the UI says 'add comment', #2 and #3 are going to follow as a consequence of human nature, how people interact with software, and the fact that <strong>you're trying to use 'comments' in a way that's different from how the rest of the Internet uses comments</strong>. And as long as #2 and #3 happen, #4, #5, and #6 will follow. </p>\n\n<p>There are two things I can see that will break the cycle:</p>\n\n<ol>\n<li><p><strong>Stop saying 'comment' if you don't really mean 'comment'</strong>. Change that 'add comment' to 'suggest an improvement' or 'message the author' or something else that's more in line with what you actually want people to do. </p>\n\n<p>And then next to it perhaps put a 'discuss this question/answer' (or even a 'comment') link that opens chat (preferably a lightweight version of chat, that lets people leave their initial message in a way that's similar to how 'add comment' currently works).</p></li>\n<li><p><strong>Abandon the modified definition of 'comment'</strong>. Just let people make comments, and only hit the 'Delete' button when something truly abusive, obscene, nonsensical, or off-topic gets posted. </p>\n\n<p>I'd argue that this would be in-line with how the current Stack Exchange UI 'expects' to be used. Long strings of comments auto-collapse, so that only the highest rated ones are displayed and an extra click is needed to view the complete thread. So the feature is self-limiting, in that once a certain threshold is reached adding more comments to a post does not actually add any more clutter into the interface. Perhaps that threshold could be dialed down to just 3 or 4 comments. </p>\n\n<p>Granted not all comments will be 'useful', but a good number of them will. I often find very useful information in comments on SO, particularly in terms of updates being provided against an older answer that has been superseded or modified by new information (you might say that the author should just update the original answer, but that doesn't always happen; particularly on older answers). </p>\n\n<p>I'm grateful for the comments on SO. They've helped me many times. I don't see why comments on The Workplace need to be handled any differently, and I find it concerning that on this site I've seen many helpful comments just disappear into nothing. I don't believe such deletions improve the quality of the QA site, and I think it's doing a disservice to the people who took the time to post those comments.</p></li>\n</ol>\n\n<p><strong>Bottom line:</strong> As long as your interface says 'add comment', that's what people will do. If you don't want that, fix the interface.</p>\n" }, { "answer_id": 2758, "author": "Monica Cellio", "author_id": 325, "author_profile": "https://workplace.meta.stackexchange.com/users/325", "pm_score": 3, "selected": false, "text": "<p>Since the problem isn't the <em>average</em> number of comments but that there are some <em>big, fast-growing clumps</em> of them, would it be possible to raise the bar for entry on <em>those</em> posts? It's far better to prevent chatty/non-constructive/argumentative comments from getting there in the first place than to clean them up later, if we can manage it.</p>\n\n<p>How might we do that? Here are some possibilities:</p>\n\n<ol>\n<li><p>Lower the number of comments needed before you get the \"let's continue this in chat\" suggestion. I don't know what that threshold is right now, but it seems to allow two people to go back and forth three or four times right now. And when that happens it's usually an argument, and arguments have high likelihood of not being useful.</p></li>\n<li><p>Have something like protection that restricts commenting. This would allow moderators (or the community, preferably) to prevent drive-by comments on posts that are getting a lot of activity. Like protection, it should require a certain amount of reputation <em>on this site</em> to be able to comment.</p></li>\n<li><p>When comment velocity reaches a certain threshold (N comments/hour), either temporarily prevent further comments (for some number of hours) or queue comments for review. (That last probably won't happen as it's major new work, but comment review could help with other situations too, like new users' first comments.)</p></li>\n</ol>\n\n<p><strong>An aside</strong>: Requesting clarification to a post is one of the primary purposes of comments. So long as the issue remains we should keep those comments. So it needs to remain possible to leave them; turning off all commenting would be too extreme. It's most of the <em>other</em> uses of comments that cause problems, and that my suggestions above are intended to counter.</p>\n" }, { "answer_id": 2780, "author": "jmac", "author_id": 7945, "author_profile": "https://workplace.meta.stackexchange.com/users/7945", "pm_score": 3, "selected": false, "text": "<p><a href=\"https://workplace.meta.stackexchange.com/questions/2748/our-comments-problem#comment6087_2753\">gnat asked</a>:</p>\n\n<blockquote>\n <p>could you get similar data for ratio of comments to posts but limited only to posts having comments? I mean, like, if there are for example 99 posts without comments at all and one with 100 comments, saying \"average 1 comment per post\" wouldn't be very informative, I'd prefer a more detailed breakdown, like, using same example, \"1% posts has comments and posts having comments get 100 comments average\", something like that</p>\n</blockquote>\n\n<p>I ran <a href=\"http://data.stackexchange.com/stackoverflow/query/210055/comment-distribution\" rel=\"nofollow noreferrer\">a query</a> to get the number of threads with certain bins of comments. I realized as I was doing the analysis, that part of the reason that Jon's analysis seems so reasonable is that it is looking at <em>per post</em> stats whereas as mods we look at <em>per thread</em> stats. After all, if you get a flag on a comment on an answer, you end up scrolling up to the question, and seeing all the comments on the way. That means that the feeling of being overwhelmed by comments is not limited to a single post, but rather a set of posts all attached to the same question.</p>\n\n<p>I ran this for all (non-meta) sites on the network, and to make the data a bit more accessible, I took the biggest commenting sites from Jon's post, and SO as a comparison, and charted the \"# of comments curve\", or cumulatively what % of posts have under that amount of comments:</p>\n\n<blockquote>\n <p><img src=\"https://i.stack.imgur.com/pJeWa.png\" alt=\"% of Post Threads with Under X Comments\"></p>\n</blockquote>\n\n<p>So basically, the further left the curve starts, the larger % of post threads have fewer comments. So in Stack Overflow's case (the blue line) about 95% of posts have under 10 comments in the Q&amp;A thread. This may be a bit difficult to grok, and that's okay, it's a ton of data and a poor attempt to make it simple, so what I invite you to look at is the far right of the chart, where The Workplace is dramatically lower than any other site on the list.</p>\n\n<p>2.1% of all TWP post threads get <strong>over 50 comments</strong> -- that is absolutely massive, and a significant distraction from the Q&amp;A. Since the dawn of time, that is 112 different threads with over 50 comments, and of those, 54 (48.2%) have happened since we graduated. Here are the 9 threads since graduation that have gotten over 100 comments:</p>\n\n<ul>\n<li>2014-03 - <a href=\"https://workplace.stackexchange.com/q/20098\">Project Manager asks for complete 100% confidence everytime committing code</a> (108)</li>\n<li>2014-03 - <a href=\"https://workplace.stackexchange.com/q/21292\">When should I include information in my resume to indicate I have a high IQ?</a> (101)</li>\n<li>2014-04 - <a href=\"https://workplace.stackexchange.com/q/22041\">I received a written warning for my performance, how can I save my job?</a> (113)</li>\n<li>2014-04 - <a href=\"https://workplace.stackexchange.com/q/22270\">How can I communicate better with a co-worker who is not a good listener?</a> (103)</li>\n<li>2014-04 - <a href=\"https://workplace.stackexchange.com/q/23388\">Do I have to relinquish my PC password to my former boss?</a> (131)</li>\n<li>2014-05 - <a href=\"https://workplace.stackexchange.com/q/23705\">How should I deal with bullying while looking for a new job?</a> (103)</li>\n<li>2014-06 - <a href=\"https://workplace.stackexchange.com/q/27116\">I&#39;m not being hired, presumably because I have Asperger&#39;s. Is there anything I can do about it?</a> (144)</li>\n<li>2014-06 - <a href=\"https://workplace.stackexchange.com/q/27484\">Administrator thinks I, an IT volunteer student, am hacking the school network</a> (102)</li>\n<li>2014-07 - <a href=\"https://workplace.stackexchange.com/q/30533\">Is there a dress code for women in software industry?</a> (191)</li>\n</ul>\n\n<p>Let's take that last one. There were 15 posts totalling roughly 29,000 characters (at 6 characters per word, that's roughly 5,000 words). There were additionally 191 comments totalling roughly 51,000 characters. That's roughly 8,500 words using the same math. The reading volume of the comment exceeded the reading volume of all the posts combined. When comments balloon, they create a significant additional burden to the reader to slog through for people who are coming in from a search engine looking for a straight answer.</p>\n\n<p>At an average reading speed of 250 words per minute, it would take 20 minutes to get through all the posts. To dig through the comments would be an additional 34 minutes. That is a significant additional burden to ask our visitors. That's why comments are intended to be temporary, so that they don't distract. But 191 comments means someone has to go through and clean up 191 comments -- that someone is the mod team. And at the very least, the mod team has to read through those 34 minutes of comments to decide what to keep, and usually several times over several days as the flags roll in.</p>\n\n<p>We are definitely getting a lot more comments grouped up than we used to, and we are definitely pretty unique among the network in the number of extremely-high-volume comment threads we get (even when compared to places with higher numbers of comments per post). </p>\n" }, { "answer_id": 2798, "author": "System 360", "author_id": 25372, "author_profile": "https://workplace.meta.stackexchange.com/users/25372", "pm_score": 2, "selected": false, "text": "<p>Let me see if I understand all this. This is a community driven site, correct? The community finds some questions/answers uninteresting and posts few comments. The moderator looks down upon this and declares it is good. The community finds some questions and answers interesting and helpful, and posts multiple comments. The moderator looks down upon this and declares it bad. Perhaps your problem could be solved by prohibiting interesting questions and helpful answers.</p>\n" }, { "answer_id": 2801, "author": "System 360", "author_id": 25372, "author_profile": "https://workplace.meta.stackexchange.com/users/25372", "pm_score": -1, "selected": false, "text": "<p>In you other post, you made my point completely. Perhaps I was too subtle. If this is a community driven forum, it should be driven in the direction indicated by the community, not by your personal wants and opinions. If it's a moderator driven forum, that's not necessarily bad. Just give up the \"community driven\" claim. If the community wants to make 50 comments on a post, that means that there's great interest in the subject, and lots of people have something, if not a complete answer to contribute.</p>\n\n<p>I spent 20 years as Professor of Computer Science, hopefully enlightening such as yourself. Very early I learned that the most efficient means of education was not lecture, but group interaction. I also learned patience. I learned that everyone has something to contribute, and when I was facilitating discussion groups, it was my role to seek out those that were a little reticent and enable them to contribute. Aren't the comments on this forum much the same thing?</p>\n\n<p>If your purpose was, as you claim, education, you'd value comments, rather than trying to find a way to discourage their contribution.</p>\n\n<p>I'd guess the root of the problem is perception. Most people understand the word \"comment\" to mean something other than what you'd have it mean. You could perhaps satisfy your need for control by weighting comments. You could post the one's that meet your criteria at the top, and relegate the ones of which you don't approve, or perhaps don't understand to the bottom. That way, people could stop reading when the value fell their level of interest. </p>\n\n<p>By the way, messing with my profile was really, mature. </p>\n" }, { "answer_id": 3278, "author": "Jane S", "author_id": 33698, "author_profile": "https://workplace.meta.stackexchange.com/users/33698", "pm_score": 3, "selected": false, "text": "<p><b>Short answer:</b> Yes, comments are continuing to climb.</p>\n\n<p>I've grouped these by month, but you can see a steady trend since December last year that comments are becoming more frequent with the only drop in comment count being last month (and it's minor).</p>\n\n<p><a href=\"https://i.stack.imgur.com/z4CPC.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/z4CPC.jpg\" alt=\"Comments per month since January 2014\"></a></p>\n\n<p>So yes, after a bit of a ragged decline from March 2014 to December 2014, comments are still an ongoing problem and we need to try to keep a lid on them.</p>\n\n<p>Let's do some other quick analyses. Firstly, let's look at the total number of questions and answers (# answers is on the secondary axis):</p>\n\n<p><a href=\"https://i.stack.imgur.com/CdNPX.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/CdNPX.jpg\" alt=\"Questions and Answers\"></a></p>\n\n<p>There is a corresponding increase in the number of questions being asked each month to go with the increase in comments. However, let's trend comments against comments per question (# comments per question is on the secondary axis):</p>\n\n<p><a href=\"https://i.stack.imgur.com/zxxU0.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/zxxU0.jpg\" alt=\"Comments per Question\"></a></p>\n\n<p>As you can see, there has been very <em>general</em> trend towards the number of comments per question increasing, albeit erratically.</p>\n\n<p>Last one! Let's see how we're going with number of answers per question (on secondary axis):</p>\n\n<p><a href=\"https://i.stack.imgur.com/DANwP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/DANwP.jpg\" alt=\"Answers per question\"></a></p>\n\n<p>This figure, while a little erratic, is not increasing. So we're getting a fairly flat number of answers per question. Note that we protect questions, so this figure can be capped from \"fly ins\" who offer an answer.</p>\n\n<h2>Summary</h2>\n\n<p>So while there <em>has</em> been an increase in the number of questions being asked, there is also a trend towards the number of <em>comments per question</em> increasing. It's <em>this</em> figure we need to try to manage :)</p>\n" } ]
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: > > [![Comments by Week](https://i.stack.imgur.com/9tPWZ.png)](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: [![Comment per Post](https://i.stack.imgur.com/aH3rQ.png)](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</code> element as <code>overflow: hidden</code>. Simply overriding that style with:</p>\n\n\n\n<pre><code>#content { overflow: visible }\n</code></pre>\n\n<p>is enough to fix it.</p>\n\n<p>(However, I'm a bit worried that the <code>overflow: hidden</code> style may have been added for a reason, possibly to fix some other unrelated problem somewhere else. This needs a bit more testing.)</p>\n\n<p><strong>Update:</strong> OK, so there <em>is</em> a pretty obvious reason for the <code>overflow: hidden</code>; 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.</p>\n\n<p>Fortunately, there's a simple fix: we just need to add a <em>non-floating</em> element at the end of the <code>#content</code> div, styled with <code>clear: both</code>. And even more conveniently, we can do this with pure CSS:</p>\n\n<pre><code>#content:after { content: ' '; display: block; height: 0; clear: both }\n</code></pre>\n\n<hr>\n\n<p>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:</p>\n\n<pre><code>#scroller { background: white; border-radius: 5px }\n</code></pre>\n\n<p>makes it slightly less ugly. (The <code>border-radius</code> is just a finishing touch, to make it fit better with the general rounded design here.)</p>\n\n<p>I've added these styles to the devel branch of <a href=\"https://stackapps.com/questions/4486/stack-overflow-unofficial-patch\">SOUP</a>; 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.</p>\n\n<p>Here's what asking a question looks like to me with these fixes:</p>\n\n<p><a href=\"https://i.stack.imgur.com/xBOEm.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/xBOEm.png\" alt=\"Screenshot\"></a></p>\n" }, { "answer_id": 3205, "author": "Monica Cellio", "author_id": 325, "author_profile": "https://workplace.meta.stackexchange.com/users/325", "pm_score": 1, "selected": false, "text": "<p>Oh the irony; I see the overlap problem on <em>this</em> post, in Firefox but not in Chrome.</p>\n\n<p>Firefox:</p>\n\n<p><img src=\"https://i.stack.imgur.com/OVPPx.png\" alt=\"screen shot\"></p>\n\n<p>Chrome:</p>\n\n<p><img src=\"https://i.stack.imgur.com/qxe2Z.png\" alt=\"screen shot\"></p>\n" } ]
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: `![enter image description here](https://i.stack.imgur.com/vYwvs.png)` **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: [![Screenshot](https://i.stack.imgur.com/xBOEm.png)](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 &#39;community-ads&#39;" 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.com/23CD7.png\" alt=\"Help this community grow -- follow us on twitter!\"></a></p>\n" }, { "answer_id": 3026, "author": "Monica Cellio", "author_id": 325, "author_profile": "https://workplace.meta.stackexchange.com/users/325", "pm_score": 4, "selected": false, "text": "<p><a href=\"http://startups.stackexchange.com\"><img src=\"https://i.stack.imgur.com/Qs0TF.png\" alt=\"Visit Startups.SE!\"></a></p>\n" }, { "answer_id": 3027, "author": "Monica Cellio", "author_id": 325, "author_profile": "https://workplace.meta.stackexchange.com/users/325", "pm_score": 3, "selected": false, "text": "<p><a href=\"https://workplace.stackexchange.com/questions/20323/\"><img src=\"https://i.stack.imgur.com/x9tUK.png\" alt=\"First job? We can help!\"></a></p>\n" }, { "answer_id": 3083, "author": "Martin Schröder", "author_id": 1578, "author_profile": "https://workplace.meta.stackexchange.com/users/1578", "pm_score": 2, "selected": false, "text": "<p><a href=\"https://workplace.stackexchange.com/?tab=featured\"><img src=\"https://stack-exchange-dynamic-ads.herokuapp.com/workplace.stackexchange.com/bounty.png\" alt=\"See all questions with active bounties\" /></a></p>\n" }, { "answer_id": 3116, "author": "Monica Cellio", "author_id": 325, "author_profile": "https://workplace.meta.stackexchange.com/users/325", "pm_score": 3, "selected": false, "text": "<p><a href=\"https://communitybuilding.stackexchange.com/q/896\"><img src=\"https://i.stack.imgur.com/fGFvA.png\" alt=\"Workplace expertise wanted: how do you deal with a know-it-all?\"></a></p>\n" }, { "answer_id": 3158, "author": "Goodbye Stack Exchange", "author_id": 7560, "author_profile": "https://workplace.meta.stackexchange.com/users/7560", "pm_score": 2, "selected": false, "text": "<p><a href=\"https://writers.stackexchange.com/questions/tagged/business-writing\"><img src=\"https://i.stack.imgur.com/K4CFF.png\" alt=\"Ad for Writers site\"></a></p>\n" } ]
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).
[![Visit Startups.SE!](https://i.stack.imgur.com/Qs0TF.png)](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 &#39;community-ads&#39;" 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.com/DGvra.png\" alt=\"Help this community grow -- follow us on twitter!\"></a></p>\n" }, { "answer_id": 4287, "author": "David K", "author_id": 16983, "author_profile": "https://workplace.meta.stackexchange.com/users/16983", "pm_score": -1, "selected": false, "text": "<p><a href=\"https://workplace.stackexchange.com/questions/20323/\"><img src=\"https://i.stack.imgur.com/x9tUK.png\" alt=\"First job? We can help!\"></a></p>\n" }, { "answer_id": 4311, "author": "Goodbye Stack Exchange", "author_id": 7560, "author_profile": "https://workplace.meta.stackexchange.com/users/7560", "pm_score": 2, "selected": false, "text": "<p><a href=\"https://writers.stackexchange.com/\"><img src=\"https://i.stack.imgur.com/inhsD.png\" alt=\"Writers.SE\"></a></p>\n" }, { "answer_id": 4334, "author": "curiousdannii", "author_id": 35934, "author_profile": "https://workplace.meta.stackexchange.com/users/35934", "pm_score": 3, "selected": false, "text": "<p><a href=\"http://area51.stackexchange.com/proposals/92736/interpersonal-skills\"><img src=\"http://area51.stackexchange.com/ads/proposal/92736.png\" alt=\"Support the Interpersonal Skills site proposal\"></a></p>\n" }, { "answer_id": 4974, "author": "Ryan", "author_id": 2115, "author_profile": "https://workplace.meta.stackexchange.com/users/2115", "pm_score": 1, "selected": false, "text": "<p><a href=\"https://area51.stackexchange.com/proposals/110851/sales-and-marketing\"><img src=\"https://i.stack.imgur.com/K9sTD.png\" alt=\"Support a SE for Sales and Marketing\" /></a><br />\n<sub>(source: <a href=\"https://area51.stackexchange.com/ads/proposal/110851.png\">stackexchange.com</a>)</sub></p>\n" } ]
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).
[![Support the Interpersonal Skills site proposal](http://area51.stackexchange.com/ads/proposal/92736.png)](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 &#39;community-ads&#39;" 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.com/DGvra.png\" alt=\"Help this community grow -- follow us on twitter!\"></a></p>\n" }, { "answer_id": 5034, "author": "Ryan", "author_id": 2115, "author_profile": "https://workplace.meta.stackexchange.com/users/2115", "pm_score": 1, "selected": false, "text": "<p><a href=\"https://area51.stackexchange.com/proposals/110851/sales-and-marketing\"><img src=\"https://i.stack.imgur.com/qNohH.png\" alt=\"Support a SE for Sales and Marketing\" /></a><br />\n<sub>(source: <a href=\"https://area51.stackexchange.com/ads/proposal/110851.png\">stackexchange.com</a>)</sub></p>\n" } ]
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).
[![Support a SE for Sales and Marketing](https://i.stack.imgur.com/qNohH.png)](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 elected moderators.</p>\n\n<hr>\n\n<p>Further reading for those interested in more details:</p>\n\n<ul>\n<li><a href=\"https://meta.stackexchange.com/q/340906/165773\">Update: an agreement with Monica Cellio</a></li>\n<li><a href=\"https://workplace.meta.stackexchange.com/q/6314/168\">Resigning as moderator</a></li>\n<li><a href=\"https://workplace.meta.stackexchange.com/q/6316/168\">Resigning as moderator from Workplace.SE</a></li>\n<li><a href=\"https://meta.stackexchange.com/q/333965/165773\">Firing mods and forced relicensing: is Stack Exchange still interested in cooperating with the community?</a></li>\n</ul>\n" }, { "answer_id": 6524, "author": "dwizum", "author_id": 83999, "author_profile": "https://workplace.meta.stackexchange.com/users/83999", "pm_score": 1, "selected": false, "text": "<p>I've been spending some time in the <a href=\"https://data.stackexchange.com/\" rel=\"nofollow noreferrer\">Stack Exchange Data Explorer</a> trying to see if there are any ways to get data that may be more meaningful than the above, which doesn't really tell much of a story to me.</p>\n\n<p>Of course, I do think it's up for debate how meaningful any of this is, but there were some specific figures which I found interesting. Lately, I've been spending a lot of time looking at review queues and I've noticed that we often have a lot of questions in the close vote queue. It doesn't seem like this queue gets ignored (there are often a lot of other people looking at it, compared to other queues) so that lead me to wonder if we simply vote to close really often. It seems like we do.</p>\n\n<p>Per the above, we had 1,831 questions closed in 2019. I counted questions based on create date - we only had 4,149 questions asked in 2019. So <strong>we closed more than 44% of questions.</strong> To me, this means that either we are too aggressive with closing, or we don't go a good enough job of helping users understand what the close criteria are.</p>\n\n<p>Of those 4,149 questions asked in 2019, 3,360 of them had at least one close vote. <strong>More than 80% of questions got a close vote.</strong></p>\n\n<p>If you sum the new questions by day and compare it to questions that received a close vote on that day, we frequently have days where the number of questions that received close votes is higher than the number of new questions asked that day. In other words, there are days where we are literally closing questions faster than they are being asked.</p>\n\n<p>All of this lead me to wonder: What does this mean? <strong>It seems like we vote to close a lot</strong> but it's not immediately clear if that's problem or not. How do we know if it's a problem?</p>\n\n<p>What are our goals as a community? I feel like I've picked up on a few common themes as answers to that questionn.</p>\n\n<ul>\n<li>If we are here to curate a good body of knowledge (in the sense of maintaining a library of quality questions and answers), it seems like we are shutting people down faster than they can help us generate content. I didn't save the exact number, but something like 2,200 of our questions this year were from people who have only asked one question. We don't seem good at retaining askers.</li>\n<li>If we are here to grow the user count as a way to create new users for SE at large, see above. We seem to be frightening away a majority of new people.</li>\n<li>If we are here to <em>help</em> people who ask questions, closing 44% of their attempts to do so doesn't seem helpful.</li>\n</ul>\n\n<p>Am I missing something? Do we have an opportunity to let this data tell us something about our behaviors, and how they relate to our goals? Do I have our goals wrong? Maybe this should be it's own question, but I posted here because the data posted above are what triggered my exploration.</p>\n" } ]
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 perfectly fine:</p>\n\n<blockquote>\n <p>2012 BS, Software Development, Your School Name</p>\n</blockquote>\n\n<p>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 <em>in</em> 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.)</p>\n\n<p>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 <em>all sorts of reasons</em> -- just taking a break, wanting to gain work experience, needing to pay bills, military service, domestic reasons, and so on. </p>\n\n<p>What matters is that you clearly outline the <strong>skills you can use</strong> starting the day you get hired, either because you learned them in school or you have practical knowledge. </p>\n\n<p>Saying all the things you said would be fine <em>if you were asked</em>, 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). <em>Lying</em> shows a lack of integrity, not explaining the truth when asked.</p>\n\n<p>Just relax and send your resume around. Don't worry about the past -- there's no reason any of that should haunt you.</p>\n" }, { "answer_id": 1565, "author": "dreza", "author_id": 199, "author_profile": "https://workplace.stackexchange.com/users/199", "pm_score": 3, "selected": false, "text": "<p>Be explicit in your CV, and honest in your answers about any queries they might have during the interview or over email/phone. If you are what they are looking for then you will know when you get the job there will be no issues with anything in your past.</p>\n\n<p>Otherwise you may potentially have this lurking over your head and you may always wonder \"<em>what if they find out I took two years off</em>\".</p>\n\n<p>If they reject you because of this then accept that and move on. You can't change your past but you can project the new type of person you are (or wanting to be) going into your future. Concentrate on portraying that while accepting your decisions and actions of your past.</p>\n\n<p>Good luck.</p>\n" }, { "answer_id": 1895, "author": "acolyte", "author_id": 1374, "author_profile": "https://workplace.stackexchange.com/users/1374", "pm_score": 2, "selected": false, "text": "<p>Don't bring it up. But, if asked, explain. You'd be suprised to hear that saying essentially \"For a short time, I was not sure what I wanted out of my life. I took a break from school, and thought real hard about it, and in the end, I realized that really is the correct place for me to be, so I returned to college and finished the degree I had put aside previously,\" does not sound bad. At all. Almost everyone has something like that at least once in their lives, and the fact that you came back from it and decided that you were exactly where you should be means that you're extremely dedicated.</p>\n\n<p>Note: if you dropped out due to poor grades, then this is much more of a lie. </p>\n" }, { "answer_id": 32986, "author": "Eric J Fisher", "author_id": 18015, "author_profile": "https://workplace.stackexchange.com/users/18015", "pm_score": 3, "selected": false, "text": "<p><strong>Only completion matters</strong></p>\n\n<p>As a hiring manager, I don't care if it took you 2 years or 10 years to get a degree, to me your degree is effectively a bullet point. (an important one, but still just a note)</p>\n\n<p><strong>Why I care about the degree, but not how long</strong></p>\n\n<p>We've all heard the horror stories of professors who unjustly failed students, degrees getting dropped without notice, change in degree requirements, etc or even just working through your degree to come out debt free. All of this cause degrees to go longer than expected, and are so common that these days getting a 4 year degree in 4 years is becoming uncommon.</p>\n\n<p>That said, having that degree tells me you put up with all the bureaucracy and struggles a college student deals with, plus you learned at least a reasonable level of competency in the subject matter. Whether you can apply it remains unseen, but you at least have the well rounded knowledge pool and ability to learn that is required to earn your degree.</p>\n\n<p><strong>List only completion dates</strong></p>\n\n<p>Treat your degree as if it were the single most valuable certification you've ever earned. It needs to be in it's own little spot that says \"hey I know things!\" but isn't a life story, because frankly as a hiring manager I don't care.</p>\n\n<p>The most common format I see is:</p>\n\n<ul>\n<li><em>Name of Degree Earned, School Degree was Earned at, Year Earned</em></li>\n</ul>\n\n<p>Avoid listing start times, time taken off, degrees you didn't earn, etc. If you are still a student or pursuing post grad you can add a line saying what degree you're pursuing, where you're pursuing, and an ETA, but whether that matters to the hiring manager depends on the company and individual looking over your CV.</p>\n\n<p><strong>What if they ask about it?</strong></p>\n\n<p>Be honest, likely the question won't be \"did you take time off your degree?\" or \"how long did it take you to get your degree?\" instead you'll likely get \"What was a problem you ran into getting your degree and how did you handle it?\" or similar.</p>\n\n<p>As a hiring manager, the only interest I normally have in your backstory is to figure out how you think. Will you be reliable, do you see things through. etc.</p>\n\n<p>When a question like that is posed, be honest but answer the question without going into completely unrelated stuff. (One, because you shouldn't be telling me why not to hire you, and two I probably don't care)</p>\n\n<p>So for your example \"Well I had a great deal of stress during school, at the time I felt school wasn't necessary and decided to just jump right into my career... that didn't work out so well, it set me back quite a bit, but I went back got my degree\"</p>\n\n<p>To me this is a good answer for such a question, you made a choice under duress, it didn't work out, so you took corrective action. Pretty much the sort if thing I want to hear.</p>\n" }, { "answer_id": 47066, "author": "Vietnhi Phuvan", "author_id": 16993, "author_profile": "https://workplace.stackexchange.com/users/16993", "pm_score": 1, "selected": false, "text": "<p>You have the degree. Your next task is convincing a prospective employer to hire you on the basis of the qualifications you have acquired. It is irrelevant to a prospective employer whether you acquired your qualifications in three years or five. Unless you go out of your way and volunteer to make it relevant.</p>\n\n<p>If you did not spend the two extra years in the Big House or you did not spend two years in the hospital recovering from a chronic ailment that could blow up on you anytime or you did not get yourself fired from a string of jobs, then your prospective employer has nothing to worry about. Stop playing mind games with yourself and focus on telling your prospective employers what you bring to the table. Because if you can't convince them that you bring anything, you get nothing.</p>\n" } ]
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 would not be happy.</p>\n\n<p>You should probably ask your boss directly what they would prefer, and probably even what their advice is for how to handle this in future. (They are, after all, way more expert than you in how your industry works.)</p>\n" }, { "answer_id": 1607, "author": "ChrisF", "author_id": 7, "author_profile": "https://workplace.stackexchange.com/users/7", "pm_score": 6, "selected": true, "text": "<p>As you use \"John\" in person I'd go with that in the e-mail.</p>\n\n<p>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\".</p>\n\n<p>For anything else - holiday requests etc. stick with the less formal greeting.</p>\n" }, { "answer_id": 1621, "author": "lamwaiman1988", "author_id": 709, "author_profile": "https://workplace.stackexchange.com/users/709", "pm_score": 2, "selected": false, "text": "<p>If you want the greeting to be more formal, while not very formal, you should go with \"Dear\" instead of \"Hi\" because this give more respect to the recipient, implying your subordinate-boss relationship. </p>\n\n<p>Usually, it is enough to use the First name otherwise it would be too formal and implies that you two barely know each other - which is not the case here.</p>\n\n<p>And you can say \"Hi\" to any co-worker in the same level with you.</p>\n\n<p>I have been addressing my boss in email like this for 2 years without problem.</p>\n" }, { "answer_id": 1670, "author": "WeNeedAnswers", "author_id": 1281, "author_profile": "https://workplace.stackexchange.com/users/1281", "pm_score": 0, "selected": false, "text": "<p>When in doubt, do nowt. </p>\n\n<p>Most of the time you can just flow straight into the email.When a greeting is required, usually just saying \"Hi\" and ending with \"regards\" will suffice as this is quite commonplace. </p>\n\n<p>Other than that it depends on your relationship with this person. If you have never talked to them then you should always err on the side of caution and be formal and say Mr or Mrs/Miss/Ms.. so that would be </p>\n\n<p>\"Hi Mrs Benjamin.\" if you don't know her, or \"Hi Flo\" if you do.</p>\n\n<p><strong>Why act in these ways?</strong></p>\n\n<p>The email is already addressed to the recipient. Each email sent, one to one, the recipient is automatically assigned to be the reader. This is the departure from hand written letters. It is obvious that the email is from the sender and the recipient is a given. </p>\n\n<p>This is one of the unique features of emails being immediate asynchronous communication that is personal via a personal email account. A greeting is used as a vehicle to flow into the actual content of the email. </p>\n\n<p>The actual statement being made, the headers and footers (hi, regards) are just a way of starting and ending the email, and provided these are polite there isn't much thought given to them.</p>\n" }, { "answer_id": 21271, "author": "Vietnhi Phuvan", "author_id": 16993, "author_profile": "https://workplace.stackexchange.com/users/16993", "pm_score": 0, "selected": false, "text": "<p>It depends on the expectations of the individual boss, expectations as adjusted by the company culture and the boss's personality. If in doubt, the simplest and most direct way to find out the answer is to grab some of your co-workers and ask them how they address your boss. This is an instance where guessing is complicated but finding out is simple. When guessing is complicated and finding out is easy and straightforward, just find out.</p>\n\n<p>Having said that, in my official capacities, I plead guilty to dispensing with niceties because of the nature of my job and the nature of the firm's business - \"Server XXXX is down and out. Did you have something to do with it?\" The reason is obvious, a potentially bad situation is developing and we need to get it under control. Now.</p>\n" } ]
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 project, not the technical details of finishing it.</p>\n\n<p>This means you need to understand the project outcome, timeline and budget concerns, and understand enough about how the team will achieve these. Your job is to facilitate - help them achieve the goals (within the allocated time and budget) - there is absolutely no need for you to be conversant in the technology in order to get things done.</p>\n\n<p>Your description of yourself tells me that you are a technical person - you will be able to tell whether someone in the team is trying to pull the wool over your eyes and should be able to tell whether estimates are reasonable or not. You already have a leg up on non-technical managers in this respect - and many non-technical manager are more than capable to deliver a technical project, as they focus on their role as facilitators.</p>\n\n<p>What I am trying to say here is that you should leave the <em>technical</em> decisions to your team and balance those with the other goals and requirements of the project.</p>\n" }, { "answer_id": 2383, "author": "HLGEM", "author_id": 93, "author_profile": "https://workplace.stackexchange.com/users/93", "pm_score": 4, "selected": true, "text": "<p>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.</p>\n\n<p>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.</p>\n\n<pre><code> Weighting Plan A Plan B \nCriteria factor Score Total Score Total \n\nPerformance 4 3 12 4 16\n\nMaintainability 3 3 9 4 12\n\nDevelopment Speed 3 2 6 2 6\n\nSecurity 5 5 25 1 5\n\nTotal 52 39\n</code></pre>\n\n<p>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. </p>\n" }, { "answer_id": 2384, "author": "jdb1a1", "author_id": 1482, "author_profile": "https://workplace.stackexchange.com/users/1482", "pm_score": 1, "selected": false, "text": "<p>You can do 3 things:</p>\n\n<ul>\n<li>Get educated as quickly as possible. Buy a book and read it. This should give you the general terminology, ideas, etc.</li>\n<li>Ask for help/clarification along the way. As the manager/team leader/supervisor, part of your role is to ensure that everybody understands what is going on. The way to do that is to ask for clarification along the way. There's no shame in it, and people will have more respect for you then if you try to BS your way through.</li>\n<li>Whatever your role is on the project, do it VERY well. If your job is to harness political support in your organization for the project, be darn sure that the political support is there. Don't try to do everybody else's job, because you'll only end up cheesing everybody off.</li>\n</ul>\n" }, { "answer_id": 2386, "author": "drabsv", "author_id": 871, "author_profile": "https://workplace.stackexchange.com/users/871", "pm_score": 2, "selected": false, "text": "<p>Let's take the perspective of this situation as more of a blessing than a problem, by way of giving you the chance to hone your managerial skills. The better manager you are, the less you need to know anything about the technical details of the work being done. What's more, lack of technical knowledge could prevent (unconscious) micromanagement on your side.</p>\n\n<p>So let's go through the checklist:</p>\n\n<p><strong>a) project structure</strong> - \"Getting more familiar with the project (desired outcome, expected timeline, etc) won't be a problem\" - fine;</p>\n\n<p><strong>b) human factors</strong> - any conflicts or tension between team members?/ enthusiasm level?/ any obstacles stealing out of productivity?/ do people feel appreciated and rewarded?/ is work interesting and inspiring?/ do people see possibilities for professional growth?/ etc - you do not need any knowledge on the technical side of things to cover any of these;</p>\n\n<p><strong>c) quality control, decision making</strong> - well, come think of it, is it your job to have the final say on important decisions or is it to organize work in such a way that your team competently solve things among themselves (thanks to the mechanisms you have set up for them)? Is it your job to personally proof-check quality of work or is it to organize your people in such a way that they competently monitor, check and correct each other's work (thanks to the mechanisms you have set up for them)? A great manager should create the infrastructures/ the medium/ the soil/ the environment for the right events and let them happen on themselves rather personally act on them.</p>\n" } ]
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 financial motivation. In fact, if you try to combine intrinsic motivation with performance-based financial motivation, you'll actually <a href=\"http://www.danpink.com/drive\">reduce performance</a>.</p>\n\n<p>However, developers still need to eat. So, you need to offer a salary that's comparable to what they could get elsewhere (based on their experience), and other than that you need to separate the work from the financial reward.</p>\n\n<p>I think that's similar to what you're saying, except I'm suggesting paying them for what they bring to the table, not for what you happen to be feeding them today.</p>\n" }, { "answer_id": 2917, "author": "Telastyn", "author_id": 2196, "author_profile": "https://workplace.stackexchange.com/users/2196", "pm_score": 4, "selected": false, "text": "<blockquote>\n <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.</p>\n</blockquote>\n\n<p>The only place I've seen this be good is getting hazard pay for being on-call. Nobody <em>wants</em> to do that, and it's not motivation at that point but overtime compensation.</p>\n\n<p>Outside of that, if a programmer is being valuable to the company by doing things that others can't, or is innovating solutions for business then they deserve regular compensation relative to that value. If they're below that rate, then increasing their rate is good.</p>\n\n<p>Bonuses aren't great because programmers by and large realize that you're milking them for production, rather than recognizing their value.</p>\n" }, { "answer_id": 2918, "author": "Yusubov", "author_id": 1780, "author_profile": "https://workplace.stackexchange.com/users/1780", "pm_score": 5, "selected": true, "text": "<pre><code>raise the developer's salary since he/she is qualified and experienced enough \nto handle such a complicated task?\n</code></pre>\n\n<p>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.\"</p>\n\n<pre><code>have a policy where one can ask for money?\n</code></pre>\n\n<p>That is dangerous and bad policy for a full-time employee, however, it might be very reasonable for contractors</p>\n\n<p>Some points in regard to software developer's compensation: </p>\n\n<ul>\n<li>Pay a good market rate or above it to a good developer. Otherwise,\nthey may consider switching companies.</li>\n<li>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. </li>\n<li>Allocate enough resources to avoid employees burning out, and have a realistic manager to manage the team of developers.</li>\n</ul>\n" }, { "answer_id": 3297, "author": "DeveloperDon", "author_id": 2372, "author_profile": "https://workplace.stackexchange.com/users/2372", "pm_score": 2, "selected": false, "text": "<p><strong>Premise</strong></p>\n\n<p>A professional is paid for what they do. </p>\n\n<p>Natural consequences follow if that relationship is broken by companies or professionals.</p>\n\n<p><strong>The Mismatch of Bonuses and Research and Development</strong></p>\n\n<p>Bonuses in some companies are a lever to promote compliant and motivated behavior toward requested results. For sales, it is an article of faith that if you sell more, you earn more, and that using commission aligns the salesman's goals with the company goals. Executives are often rewarded with stock options that fluctuate proportional to the top goal the board of directors has set for them which is to increase stock holder value. </p>\n\n<p>Product development and the remainder of the company sometimes share a third bonus methodology. The idea is to reward against a benchmark for profit. No profit, no bonus. Profit above the benchmark, bonuses for everyone. Desired behavior includes good teamwork, widespread ownership of being thrifty with company resources, alignment of worker goals with the goals of the chain of command, and industrious focused contributions by each person each day. These are great goals, even without a bonus system in place because they help the company survive and give employees better job security and opportunity.</p>\n\n<p>What about a development team that labors three years to bring out a successful product? Value is created the entire time, but costs of a big project might hit the company bottom-line hard, resulting in no bonus. Sometimes, the directors give some of the executives the boot about this time, and it is no picnic for development managers or foot soldiers.</p>\n\n<p>Let's say Q1 of the fourth year, the product releases and is wildly successful.<br>\n- The sales staff makes record commissions in the same month. Their reward is almost immediate.<br>\n- The market may lag a few months, but when Q1 sales are announced, the stock jumps, the executives sell shares, some after not much involvement. Their reward is not immediate, but may be pretty efficient WRT when the market identifies accomplishment.<br>\n- What about manufacturing employees? They get some overtime, and in Q2 of year five, the company wide bonus for year four will be paid. They wait about 12 months for their work to bring a bonus. </p>\n\n<p>In contrast, for the R &amp; D staff, no bonus is paid on their three years work unless they stay at their jobs until Q2 of the fifth year. It is not sinister, or part of an evil plot. It just works out that way. For people in our profession, this is mild compared to what happens with start ups and stock options. If there is a bonus for developers at time of launch, at least for those who worked on the project a while, it is probably well deserved.</p>\n\n<p><strong>Some Suggestions</strong></p>\n\n<p>The moral of the story?</p>\n\n<ul>\n<li>Revenue lags R &amp; D expense, so we would need much shorter cycles in R &amp; D to permit the annual bonus model to more fairly reward the involved rather than the uninvolved. Agile, iterative, incremental approaches give us some relief from the problem if we can put product into customers hands earlier and see profit hit the bottom line while our effort is still remembered.</li>\n<li>It is difficult and potentially harmful to reward someone for a project that is not complete. But we probably do need some recognition and reward for milestones and hard to measure things like focused and methodical effort toward a goal.</li>\n<li>Patents are a prime example of a huge lag between contribution and reward. It is very hard to value a patent at its time of filing, but it may take years if the reward is tied to the time it is granted.</li>\n<li>Knowledge workers like software developers can have a huge impact on the success of their companies. The reality of high turnover among developers makes stock options an interesting instrument. It can induce some to stay, but insures their reward cycle is separated from their contribution cycle. It also means that up and down cycles in staffing may often separate developers from their reward. Shorter vesting times or simply a shared expectation of pay-as-you-go salaries in which extraordinary work is compensated with overtime without the distraction of bonus talk.</li>\n</ul>\n" }, { "answer_id": 3317, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>Here are a few points on this subject that I'd like to make:</p>\n\n<ul>\n<li>The better programmers should make more money and be given more difficult tasks.</li>\n<li>Imagine holding a contest and award a prize for the first programmer to create a solution. Good luck with anyone spending time on anything else. Or watch everyone else give up because they know the better programmer is going to win anyway.</li>\n<li>When the company has a financial windfall as a result of the developer's contribution, they need to feel they share in the extra income. Otherwise, they'll feel exploited</li>\n<li>Beware of the everything is an emergency because nothing will be considered an emergency. It can't always be done, but strive to manage sustainable workloads. </li>\n<li>Do you really want to set a precident of every little bit of extra effort is going to require a bonus attached?</li>\n<li>Before you offer more money, find out if anything else will motivate your developers. You could probably save more money than you think. </li>\n</ul>\n" }, { "answer_id": 3320, "author": "JohnMcG", "author_id": 375, "author_profile": "https://workplace.stackexchange.com/users/375", "pm_score": 0, "selected": false, "text": "<p>Joel wrote another article <a href=\"http://www.inc.com/magazine/20090101/how-hard-could-it-be-thanks-or-no-thanks.html\" rel=\"nofollow\">addressing this question more directly.</a></p>\n\n<p>In this case an intern came up with an idea that, once implemented, made $1 million for the company. What should be his reward?</p>\n\n<p>He ended up rewarding him with equity in the company, which he was pleased with, but was utlimately not enough to retain him. <a href=\"http://discuss.joelonsoftware.com/default.asp?joel.3.724112.27\" rel=\"nofollow\">We discussed this a bit on the gone but lamented Joel on Software forum</a>.</p>\n\n<p>--</p>\n\n<p>In short, hopefully your company is building a culture where people enjoy contributing to what is going on. There is always some drudgery, but in general the rewards should be aligned with skill level and results and wants the team to be successful.</p>\n\n<p>So I would say tread carefully.</p>\n" } ]
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>&lt;ul&gt;&lt;li&gt;item1&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;item2&lt;/li&gt;&lt;/ul&gt; </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 from that is that <strong>you</strong> believe they had done things incorrectly.</p>\n\n<p>You may or may not be right - it <em>could</em> just be you, you know... And your PM may not be in the position to be able to tell the right way from the wrong way.</p>\n\n<p>Instead of going to the PM, you should be talking to your colleagues. If you don't understand <em>why</em> something has been done a certain way, ask. If you consistently get evasive answers or answers that clearly show that the person is out of their depth, then you have an opportunity to educate. Show them a better way - educate them and help them learn.</p>\n\n<p>I understand this will not help with current projects, but going forward it should help.</p>\n" }, { "answer_id": 5674, "author": "pdr", "author_id": 759, "author_profile": "https://workplace.stackexchange.com/users/759", "pm_score": 5, "selected": false, "text": "<p><strong>Be sure you <em>are</em> correct.</strong></p>\n\n<p>I have mixed feelings about these kinds of questions, because I've seen both sides. As a senior developer, I've learned a lot from keen juniors who have a better sense of new techniques, etc. And I know seniors who are senior in years only, so I can sympathise if you're dealing with one of those.</p>\n\n<p>But, I have also run into juniors who don't have my experience and think they know better cause they read it on their favourite blog. So, just as a word of warning, be sure you are right before you start telling people how to do their jobs.</p>\n\n<p><strong>Don't worry about asking them why.</strong></p>\n\n<p>As a senior, part of the job is mentoring juniors. Most of us don't mind explaining our reasoning, as long as it doesn't come over as defending our seniority. And hey, you never know, you might learn something.</p>\n\n<p>If it seems like you're breaking their flow too much, consider arranging regular times when you can sit down with this developer and have these kinds of discussions.</p>\n\n<p><strong>Don't say \"You're doing it wrong.\"</strong></p>\n\n<p>You're right to worry that this comes over as pretentious. Rather, say \"Hey, I read about this technique the other day and I wondered what your thoughts were.\"</p>\n\n<p>Sit them down and refactor their code, show them how it is easier to read afterwards, and how you only have to make a small change to implement your new requirement. Listen to their concerns, look for answers to those concerns, continue the discussion over time.</p>\n\n<p>And be prepared to hit situations where you just cannot win the argument, even if you're absolutely correct. One day you'll be that senior and <em>sometimes</em> you'll have to put your foot down and say \"No, I really believe this way is better.\" And you won't want juniors being sulky about that.</p>\n\n<p>But, if that happens over and over again, you might have to consider grabbing as much experience as you can stand and then going on to work somewhere else.</p>\n\n<p><strong>Don't bring the PM into this.</strong></p>\n\n<p>It's not his job to worry about implementation details. It's your's and your senior's. Keep the discussion at that level. Do, however, bring in other developers, if there are any.</p>\n\n<p><strong>In response to \"This client is a massive, multi-billion dollar, high-level business.\"</strong></p>\n\n<p>Even Facebook have made mistakes, some <a href=\"http://mashable.com/2012/09/11/html5-biggest-mistake/\">by their own admission</a>. If only we could all say we've made mistakes and still be worth billions of dollars. You can understand why people that have been around a while might think they're doing things very, very right.</p>\n\n<p><strong>In short ...</strong></p>\n\n<p>You have to concede their seniority, but you should challenge them. That's the line you have to walk.</p>\n" }, { "answer_id": 5675, "author": "Karl Bielefeldt", "author_id": 180, "author_profile": "https://workplace.stackexchange.com/users/180", "pm_score": 6, "selected": false, "text": "<p>Just factor necessary technical debt fixing into your estimates. Everyone who works on a team must deal with it, some places more than others. People also improve as they gain both general experience and experience on a specific project. Work somewhere long enough, and eventually you will look in source control to see what \"idiot\" designed some code, and discover it was yourself.</p>\n\n<p>You don't have to blame someone else, just blame the code if you must. Say it needs refactoring in order to ensure you're implementing the solution correctly. If your colleague is truly as bad as you think he is, he will eventually be naturally migrated off of design tasks like that. Include him on code reviews so he can learn from what you do.</p>\n\n<p>Try to resist the temptation to completely rewrite something you don't like. Make incremental improvements using the \"boy scout rule\": leave a campsite a little cleaner than you found it. A good programmer can find ways to work with legacy code without needing it to be perfectly clean. </p>\n" }, { "answer_id": 5676, "author": "FrustratedWithFormsDesigner", "author_id": 155, "author_profile": "https://workplace.stackexchange.com/users/155", "pm_score": 3, "selected": false, "text": "<p>You think they did things wrong, but before you confront them, have you considered <em>why</em> they might have done the things they've done?</p>\n\n<p>Possible reasons I can think of (and have seen) that the senior developer has coded \"nearly everything wrong\":</p>\n\n<ol>\n<li>They don't know how to do it right.</li>\n<li>There isn't time to do it right if deadlines are tight.</li>\n<li>They inherited crappy legacy code and don't have time to clean it up.</li>\n<li>They know it's bad and they plan to fix it later.</li>\n<li>They just don't care.</li>\n</ol>\n\n<p>In my experience, #2 and #3 are the most common reasons for this sort of thing to happen. Sometimes they are related when #3 leads to #2.</p>\n\n<p>How to talk to this person:</p>\n\n<p>Say you are concerned about the maintainability of some pieces of code. <em>Show</em> them an example and explain why that particular example concerns you. It will help a lot if you have trouble tickets that you can directly link to poorly written code. This will open the discussion and you will be able to ask them <em>why</em> the code is the way it is, and how to go about changing it.</p>\n\n<hr>\n\n<p>With regards to the HTML example you posted:</p>\n\n<p>Ok, I agree that it is a little bizarre-looking, and I can't think of a reason to do it that way. I think it would be ok to just say to this person who wrote that:</p>\n\n<blockquote>\n <p>I've never seen a list done like that before. Is this better than the standard way?</p>\n</blockquote>\n" }, { "answer_id": 5677, "author": "IDrinkandIKnowThings", "author_id": 16, "author_profile": "https://workplace.stackexchange.com/users/16", "pm_score": 2, "selected": false, "text": "<p><strong>You have obligations to your employer not to the client.</strong> You are performing work for your employer not for their client. </p>\n\n<p>I am going to give you the benefit of the doubt that the senior developer did it wrong. I know I would love to go back and redo some of the things I did in the past and do them better. It happens as programming is a constant learning experience. So I would start by stepping back and instead of blaming anyone for what exists, figure out how to deal with it. There is no need for you to point the finger and dress down the senior. </p>\n\n<p>I would get with the development team and discuss what you think needs to be done to bring the application up to par. Especially focus on if this is something that can be done incrementally so as to reduce the risk. Since if you have to overhaul the entire application you are increasing the risk of bugs. Be able to communicate the risks that exist with not fixing the problems. Realize that businesses do not want to spend money on redoing things that work fine just because there is something better. You need to be able to show that what exists is a potential problem and that it is only a matter of time before that problem becomes an emergency. </p>\n\n<p>From there the team can decide how to address the issue. If a dressing down is due then management will likely get involved when they learn the hours that will have to be spent to fix it. There is no need to concern yourself with that. However if the team decides to just continue with the current code you need to be prepared for that. Your responsibility is to make your employer look good so deliver the best product you can with out making them look bad to the client. If you involve the client it will cause problems for your employer and will reflect badly on you.</p>\n" }, { "answer_id": 5680, "author": "Dan Burton", "author_id": 1136, "author_profile": "https://workplace.stackexchange.com/users/1136", "pm_score": 6, "selected": true, "text": "<p>A few thoughts.</p>\n\n<p><strong>Dealing with ugly code</strong></p>\n\n<blockquote>\n <p>The code I am forced to utilize on tight deadlines is typically unacceptable</p>\n</blockquote>\n\n<p>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 <em>will</em> 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 <strong>choose your battles wisely</strong>. 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. <strong>Be decisive</strong>. Decide <em>for sure</em> 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 <em>\"I make decisions; I'm in control.\"</em></p>\n\n<p><strong>Being a jerk</strong></p>\n\n<blockquote>\n <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>\n</blockquote>\n\n<p>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 <strong>confront it</strong>, and clearly explain <em>why</em> you think it's wrong. However, while you do this, <strong>be open to correction</strong>. 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 <em>still</em> help others identify mistakes they otherwise would have missed (and people appreciate that), or the others will help correct <em>your</em> mistake (which you should appreciate).</p>\n\n<p><strong>Climbing the ladder</strong></p>\n\n<blockquote>\n <p>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.</p>\n</blockquote>\n\n<p>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.</p>\n\n<p><strong>Ms Frizzle's advice</strong></p>\n\n<p>Nobody expects you to be perfect, and nobody expects you to consider them to be perfect. So go out there, <strong>take chances, make mistakes, get messy!</strong></p>\n" }, { "answer_id": 5685, "author": "amphibient", "author_id": 3298, "author_profile": "https://workplace.stackexchange.com/users/3298", "pm_score": 1, "selected": false, "text": "<p>If you <strong>do it politely and properly inform all the stake holders</strong>, I don't see why it should be a problem. Look, I know many people will disagree with me BUT I think that, in this day and age, <strong>society, and the workplace along with it, place waaaaaaaaay too much importance on things like EQ</strong> and making everyone feel good about things they should and shouldn't have to feel good about. I have done exactly what you describe MANY TIMES and yes, some people were pissed and some had a more rational reaction. I think we have overengineered our emotional complex and the two clear pitfalls of that are:</p>\n\n<ol>\n<li>People have become wusses .</li>\n<li>One must constantly run checks in the back of their mind how whatever they are doing will emotionally affect everyone involved (so called \"empathy\"). And that's just a waste of time most of the time, IMO. (high maintenance)</li>\n</ol>\n\n<p>So if you <strong>fix something and make it better, document it properly and demonstrate your improvement in one way or another</strong> if you are concerned that it may be considered impertinent of someone at your level of seniority to rock the more established elements. If you do that, I guarantee you that you will garner more respect than animosity in the net yield. <strong>Be polite and do your homework.</strong> If you are making an improvement overall, it shouldn't be too much to expect your surrounding to react <strong>RATIONALLY AND NOT EMOTIONALLY</strong>.</p>\n\n<p>If you want to be successful, <strong>if you want to GET ANYTHING DONE, if you want to be of any effect beyond a little organizational gopher -- you will have to get used to making calculated sacrifices</strong> in terms of alliances, i.e. you will have to create some animosity. You have to be careful who you piss off though. But <strong>if you aim to please everyone and are scared of pissing people off -- you will fail miserably</strong>.</p>\n\n<p>So the net effect is what counts. I love refactoring other people's code. You should do it. But beware that there are extra steps involved when you overhaul the work of someone who is still there, alive and ready to challenge your taking on his baby.</p>\n\n<p>As far as \"emotions in the workplace\" are concerned and the infestation of emmo culture in the Western world, all I got to say is that I doubt the railroads would have been built back in 1800 if the builders were touchy-feely. That's why I like working with people who have been either in construction or military cause they are thick skinned. But you can't always choose. </p>\n" }, { "answer_id": 5691, "author": "george_h", "author_id": 4623, "author_profile": "https://workplace.stackexchange.com/users/4623", "pm_score": 1, "selected": false, "text": "<p>I think the best way to go about it is to be positive and constructive when telling your colleague how to fix their code. Whatever the age or experience the approach is always the key. You should always make the initial approach with a positive statement. Then lean forward to constructive criticism. This way they don't feel that you're telling them they are doing it wrong, even if they really are.</p>\n\n<p>Usually they will realize that by themselves and keep it quiet, but still save face at the same time. It is also very good to discuss with your colleague the best practices that are in use for that particular task. You can show them websites and cite popular documents that \"Pros\" use.</p>\n\n<p>Then lastly you can end the session by saying that even the seniors and pros used to make similar mistakes like those when they started out. It helps gives your colleague a feeling that it's ok to get their mistakes found out because it's a learning process that even pros go through.</p>\n\n<p>So the cycle kind of looks like this</p>\n\n<ol>\n<li>Approach positively</li>\n<li>Provide constructive criticism</li>\n<li>Discuss the better ways of performing the task</li>\n<li>Show that even experts were once beginners who knew nothing</li>\n<li>It's all about learning new things</li>\n</ol>\n" }, { "answer_id": 120296, "author": "boni aditya", "author_id": 93040, "author_profile": "https://workplace.stackexchange.com/users/93040", "pm_score": -1, "selected": false, "text": "<p>TRUTH TO POWER</p>\n\n<p>NEVER TALK TRUTH TO POWER, THE FIRST THING THAT A KING WOULD DO WHEN HE SEES SOMEONE SPEAKING TRUTH TO HIM, HE WOULD GET HIM TO THE GALLOWS!</p>\n\n<p>YOU REMEMBER THE STORY ABOUT THE NAKED KING AND THE INVISIBLE CLOTHES, nobody was willing to speak TRUTH TO POWER i.e. the fact that he was naked, excepting a child who had no idea about POWER OF THE KING - What ever happened to that poor child! The king might have killed him! My advice is - Don't be that child!</p>\n\n<p>So if the man holds power, i.e. if he has worked there for three to five years, he would have a tight network with all the people there and you will immediately make not one but one + network full of enemies. What is the nature of the person, can the person take it? Is the person receptive to feedback? That should also be considered into the equation. You should also consider if you meet the PM by surpassing him, would he consider it a betrayal? So this isn't a simple YES/NO decision. This decision requires careful analysis taking into account the personalities of people involved. Are they political? What are the ego levels of people involved. </p>\n\n<p>Please don't create a pros and cons list of what will happen I if report vs what will happen if i don't</p>\n\n<p>Instead try to create a mind map about the political possibilities, often there are more than 100 different ways in which this simple reporting of bad code situation can turn out into and each of these end results are going to be decided by the simple fact! What do you want?</p>\n\n<p>The society in general hates people who are straight! i.e. people who speak the truth - It is the straight trees that get the axe.</p>\n\n<p>So are you strong enough to take the axe? Have you witness a similar activity i.e. reporting in the organization before. Do you have a precedent to act upon? </p>\n\n<p>So my advice from the little info that you have posted in this situation is</p>\n\n<ol>\n<li>You are a junior dev, he is a senior dev, your word against his to the PM, whose words do you think would be more respected!</li>\n<li>He holds sway over the project and is the one responsible for the project, you are only the sidekick helping him. Thus the senior dev has his ass on the line, not you!</li>\n<li>Going to the PM is almost always throwing rocks at the hornets nest. If you go to the boss directly the senior dev will become you permanent enemy and will never trust you with anything.</li>\n<li>He has survived for so long, may be this is the only project which he could not get right, a project with bad foundations will end up bad! Thus you should give him some more time and observe him for a few more projects, before you conclude that he does not know how to program or does not follow programming standards.</li>\n<li>It would be wise to take senior dev to a dinner or lunch and then ask him why the project is running into so may glitches and then slowly push your observations.</li>\n<li>Don't make the capital mistake of striking a conversation in the corridor, or taking the person into a conference room for \"discussion about code\" That will create ruckus! </li>\n</ol>\n\n<p>Anyway handle the situation carefully, but if it was your co-dev i.e. another junior developer, you could directly go to the PM and snitch anonymously, because there is not TRUTH TO POWER involved! </p>\n\n<p>I have take these frameworks from the book \"DECISIVE\" you can learn a lot about decision making from this book, please check it out</p>\n" } ]
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 job opportunity your are pursuing.</p>\n\n<p>You should always craft your résumé carefully with the reader in mind. These days you also need to consider automated résumé parsers.</p>\n\n<p>In other words, if you think that the hiring manager will look more favorably on the 'owner' keyword vs. the 'illustrator' keyword, then I would use 'owner'.</p>\n\n<p>For example, if the potential hiring manager is looking after entrepreneur-type people I would use 'owner' and if the hiring manager is more inclined to look for creative-type people I would use illustrator.</p>\n" }, { "answer_id": 6580, "author": "jcmeloni", "author_id": 26, "author_profile": "https://workplace.stackexchange.com/users/26", "pm_score": 5, "selected": true, "text": "<p>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. </p>\n\n<p>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).</p>\n\n<p>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.:</p>\n\n<pre><code>Freelance writer/illustrator, date start to date end (or \"present\")\n - description of types of jobs you completed \n - list your published work\n - other important qualities or skills performed\n</code></pre>\n\n<p>then that is far more beneficial and true to me than \"owner\" would be.</p>\n\n<p>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 <em>can</em> be off and on; that's expected. For example, on my own resume (here's what it looks like on <a href=\"http://www.linkedin.com/pub/julie-meloni/40/837/1ba/\">LinkedIn</a>, 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. </p>\n\n<p>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.</p>\n" } ]
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 for the whole period?</p>\n</blockquote>\n\n<p>Yes, they will. A role against a period would indicate that you have done that role throughout the period.</p>\n\n<blockquote>\n <p>And if so should I make it clear that I wasn’t always a Senior Banana in Company A?</p>\n</blockquote>\n\n<p>Yes, you should. The thing to do is split the period into the different roles and how long you were doing each.</p>\n\n<blockquote>\n <p>If I put in specific promotions, will this devalue the current title?</p>\n</blockquote>\n\n<p>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).</p>\n\n<p>In fact, this is something to <strong>highlight</strong>.</p>\n\n<pre><code>2010-2013 Apple Company B\n details of role and responsibilities\n\n2009-2010 Promoted to Senior Banana - Company A \n details of role and responsibilities\n\n2008-2009 Promoted to Banana - Company A\n details of role and responsibilities\n\n2007-2008 Junior Banana - Company A\n details of role and responsibilities\n</code></pre>\n\n<p>Alternatively:</p>\n\n<pre><code>Company B - 2010-2013:\n-----------------------\n2010-2013 Apple\n details of role and responsibilities\n\nCompany A - 2007-2010:\n----------------------\n2009-2010 Promoted to Senior Banana\n details of role and responsibilities\n\n2008-2009 Promoted to Banana\n details of role and responsibilities\n\n2007-2008 Junior Banana \n details of role and responsibilities\n</code></pre>\n" }, { "answer_id": 7579, "author": "pdr", "author_id": 759, "author_profile": "https://workplace.stackexchange.com/users/759", "pm_score": 2, "selected": false, "text": "<p>There are a couple of different issues here.</p>\n\n<p>First, are you planning to go on being an Apple or a Banana? If an Apple, I would be inclined to list Banana, with no particular prefix, for the full period of your first employment. The reason for this is that I want to focus their minds on the latest employment.</p>\n\n<p>This might change if being a Banana specifically helped me become an Apple.</p>\n\n<p>Second question you have to ask yourself is, did your roles and responsibilities change with the promotions? If so then there is more advantage to showing all three roles, each with specifics as to what I'd achieved in each role.</p>\n\n<p>However, if the promotions were largely arbitrary (I had three promotions in my first job because it was the only way they could convince their bosses to give me more money, but I was never TRULY a senior anything), I would pick a single title and go into detail as to what I achieved at the company as a whole.</p>\n\n<p>I will tell you that I've trashe- err, filed CVs where a candidate has overvalued their real position -- eg. claimed to be a Senior Orange, after one year of experience, but never showed any indication of mentoring a single Junior Orange, or anything else that I would consider a Senior responsibility. So think hard about it.</p>\n\n<p>In the end, you have to ask yourself what message you want to convey, then figure out how to convey it most efficiently. That's the challenge in writing a CV.</p>\n" }, { "answer_id": 7581, "author": "Dan", "author_id": 5425, "author_profile": "https://workplace.stackexchange.com/users/5425", "pm_score": 2, "selected": false, "text": "<p>I would go so far as to say that people thinking you've done one role for [x] years is absolutely terrible if that's not the case. Promotions and advancement are regarded as positives, they show you're not just drifting along, that you rise to challenges and that you seek to better yourself. </p>\n\n<p>It becomes a bit grey if the changes are sideways (Or even worse, downwards), but ultimately, you should treat every single role / promotion as a new job and list it as such. e.g: </p>\n\n<p><strong>Oranges Inc</strong>, Senior Developer (Seattle, 2010 - 2013)</p>\n\n<p>Accomplishments etc here</p>\n\n<p><strong>Banana Inc</strong>, Senior Developer (New York, 2009 - 2010)</p>\n\n<p>Accomplishments etc here</p>\n\n<p><strong>Banana Inc</strong>, Development Engineer (New York, 2008 - 2009)</p>\n\n<p>Accomplishments etc here</p>\n\n<p><strong>Banana Inc</strong>, Junior Developer (New York, 2007 - 2008)</p>\n\n<p>Accomplishments etc here</p>\n\n<p>There is absolutely nothing wrong with that at all. In fact, in my personal case, one of the jobs which I list on my CV (And make a point of, too, as it was the sort of role I wanted) was actually a 6 month secondment. If it had been unimportant I may have rolled it into my 'day job' but I wanted to highlight it, so listed it separately.</p>\n" } ]
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, so you can compare them? Or do you want to translate the message that the candidate is trying to put across?</p>\n\n<p>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)?</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>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?</p>\n" }, { "answer_id": 7607, "author": "Jacob G", "author_id": 75, "author_profile": "https://workplace.stackexchange.com/users/75", "pm_score": 3, "selected": false, "text": "<p>Why not just use a straight-up skills matrix at the top? List technology, years used and self-evaluated proficiency. Then, for each employer or project listed below, specifically call out the technologies used. </p>\n\n<p>Something like this:<br>\n<img src=\"https://i.stack.imgur.com/DxUpv.gif\" alt=\"sample skills matrix\"></p>\n" }, { "answer_id": 7613, "author": "A. Gilfrin", "author_id": 5444, "author_profile": "https://workplace.stackexchange.com/users/5444", "pm_score": 3, "selected": false, "text": "<p>I think it would be a bad idea, while people are often looking for skills, what they really want to see is how those skills have been applied and used. A traditional CV layout allows people to see what you have actually done rather than what you know, the frame work should be what you have achieved in roles and then the skills hang off that. </p>\n\n<p>While I applaud your search for an employer that is less conservative often jobs will be via an agency and the employer will never see your handy work. At a push I'd suggest have two versions of your CV, one traditional and one like yours and distribute accordingly, although I suspect often your new way won't be read. </p>\n" }, { "answer_id": 7615, "author": "Tiago Cardoso", "author_id": 3295, "author_profile": "https://workplace.stackexchange.com/users/3295", "pm_score": 0, "selected": false, "text": "<p>I second XYZ_909 opinion, the job description shows to your interviewer <strong>how you've applied the knowledge you have</strong>, instead of simply listing the knowledge you (allegedly) have.</p>\n\n<p>Ok, you're planning to list the technologies you're used to work with. I assume you plan to add to them, depth of knowledge you have on each of them (like Jacob's table), right? </p>\n\n<p>So, the underlying question is... <strong>how do you plan to present the <em>depth</em> of knowledge on each technology</strong>? <em>My</em> 'expert / average / basic' concepts might be quite different from yours. That's why the technology experience level (regardless how you measure it, by years of experience, by certifications, etc) is kept on the second plan: <strong>It's biased</strong>.</p>\n\n<p>So, if you decide to go ahead with your format, make sure you really know how to explain your depth of knowledge on each technology. Eventually, it's done by presenting your past job experiences... that's why (I believe) a CV is structured as we know.</p>\n" }, { "answer_id": 8627, "author": "GreenMatt", "author_id": 2317, "author_profile": "https://workplace.stackexchange.com/users/2317", "pm_score": 4, "selected": false, "text": "<p>What you're describing seems similar to a <a href=\"http://en.wikipedia.org/wiki/Functional_resume#Functional_r.C3.A9sum.C3.A9\" rel=\"noreferrer\">functional resume</a>. I do see some attractiveness to using such a format. </p>\n\n<p>That said, in poking around the web a little, it seems current thinking is that most job hunters should use the traditional <a href=\"http://en.wikipedia.org/wiki/Functional_resume#Reverse_chronological_r.C3.A9sum.C3.A9\" rel=\"noreferrer\">(reverse) chronological resume</a>, as use of a functional resume is seen as problematic. Some of the problems:</p>\n\n<ul>\n<li>Hiring managers want to be able to quickly look over your career and see how it has progressed and what you have accomplished. Listing skills instead of jobs and projects makes this sort of review difficult or impossible.</li>\n<li>Hiring managers also grow suspicious of people using functional resumes as they (the managers) fear the job seeker may be hiding something (e.g. a large gap of unemployment).</li>\n<li>Many (most?) companies now use software to pre-screen resumes and it seems this sort of software cannot process functional resumes.</li>\n</ul>\n\n<p>It seems that most resume/career advisors suggest using a functional resume only when a chronological resume can't communicate what you need. For example, if you seek a career change, a functional resume may be better able to show what skills you have developed that would be applicable to the new field. <a href=\"http://www.quintcareers.com/functional_resume.html\" rel=\"noreferrer\">This article at Quintessential Careers</a> has more details.</p>\n" }, { "answer_id": 8631, "author": "HLGEM", "author_id": 93, "author_profile": "https://workplace.stackexchange.com/users/93", "pm_score": 2, "selected": false, "text": "<p>AS someone who has done a lot of hiring through the years, a skills list that took up the entire first page would turn me off. I know you have the skills I need officially listed or the resume would have never gotten to me. Yes, you need one in the resume somewhere to get past the automated filters in HR. But the person who will be making the final decision to interview you is more interested in what you have accomplished than what you know as long as what you know meets a certain minimum for the job. So my first priority in looking at your resume is accomplishments which are either presented in a separate accomplishments section or in the chronological part of the resume (please do not make this a simple listing of job responsibilities either, I am not interested in what you were responsible for, I am interested in what you did). This is what should always be first.</p>\n" }, { "answer_id": 8830, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>As an employer, I would want to know if you are capable of being an employee at a company (hopefully similar to mine). Excessive job changes and/or gaps in your employment are a red flag regardless of your skill level. </p>\n\n<p>I wouldn't expect a resume to only indicate the skills I'm looking for that apply to the job, but there should be some focus.</p>\n\n<p>Validation - at some point, you need to convince me you can build the things I need. Prior successes are very helpful. The interview is more likely the place where you'll be able to show you know this stuff and can learn new things.</p>\n" }, { "answer_id": 171274, "author": "Vorac", "author_id": 1382, "author_profile": "https://workplace.stackexchange.com/users/1382", "pm_score": -1, "selected": false, "text": "<p>My solution: create a <a href=\"https://github.com/MiroslavVitkov/CV/blob/master/build/CV.pdf\" rel=\"nofollow noreferrer\">word cloud of skills</a> as a cover page of the CV. Is it a good idea? I don't care: it expresses who I am.</p>\n<p>I plan to eventually format the cover page as:</p>\n<blockquote>\n<p>word cloud for coding (main skill)<br />\nword cloud for electronics (secondary skill)<br />\nword cloud for mechanical engineering (tertiary skill)<br />\nName (so it stands out and is kind of memorable)</p>\n</blockquote>\n<p>I wanted to link to some word cloud generating software but there are so many solutions with different constraints that a one size fits all solution doesn't seem to exist.</p>\n" }, { "answer_id": 171387, "author": "Nathan Cooper", "author_id": 8157, "author_profile": "https://workplace.stackexchange.com/users/8157", "pm_score": 1, "selected": false, "text": "<p>Firstly, people flicking through resumes don't have time for things that are special and different. You'll get screened out of at lot of jobs before anyone even reads it.</p>\n<p>If anything, this resume actively 'undifferentiates' you. Listing your skills in the context of your previous jobs establishes credibility and allows a rough time-based estimation of your skill level. Only showing skills makes it impossible to see if you are a deep and wise sage when it comes to SQL or whether your wrote your first select statement last week.</p>\n<p>Using a job-first approach also would allow you to relate having these skills to how you have achieved actually outcomes for your previous employers. You've cast your skills into a vacuum and it's not clear you have a track record of actually achieving anything for anyone. You've actually made your resume less like a trader's van here.</p>\n<p>I'll explain that last point, as I think it gets to your fundamental misunderstanding. You're trying to be more 'value-based' right? You're trying to move away from &quot;here I am, please make use of me because I don't know how&quot; to more &quot;I solve this problem. I come in, I do the job, I leave.&quot; Right? But the problem is your skills aren't actually the things you're selling. They're the tools in the van. The text on the outside says &quot;I fix your sink fast&quot;, not &quot;I am a man with a socket wrench, ten spanners and fifteen allen keys&quot;.</p>\n<p>There are freelancers out there targeting people with 'broken sink problems'. They don't find their customers on traditional job boards and they don't talk to them about socket wrenches.</p>\n<p>You are an employee or, if you are a contractor, you augment employees and are hired in roughly the same way as them. The people who you dealing with have figured out for themselves that they need someone with X years of socket wrench and Y years of spanner to slot into their existing sink fixing team. They are actively hunting for socket-wrench-wielders on socket-wrench-job-boards. They are not interested in your special resume. Even if you fixed it to be more properly 'value-based', they've already done the work of connecting the dots.</p>\n<p>So I wouldn't recommend jumping straight from listing jobs and skills to a &quot;I solve X for Y&quot; approach, especially while you're dealing with the traditional hiring process. But it is an important first step to try and reflect why your employers/customers actually hire you and what they actually want for the money they give you.</p>\n<p>Once you've done that you then you can maybe try and subtly incorporate that into your CV without turning the format completely upside down. You also would have taken an important step towards being a &quot;value-based&quot; freelancer.</p>\n" }, { "answer_id": 171399, "author": "Simon Richter", "author_id": 12612, "author_profile": "https://workplace.stackexchange.com/users/12612", "pm_score": 0, "selected": false, "text": "<p>That is a fairly common approach for freelance contractors, who are kind of dependent on recruiters finding them when they search their database for specific skills.</p>\n<p>My own profile had a short CV section, and several pages of projects that each mentioned several technologies used, plus a section on other skills that I have, but that haven't been used in projects yet.</p>\n<p>This kind of Search Engine Optimization is frowned upon in the Internet, but works well for recruiters for contractors, because they do not generally know the technology involved and therefore don't search for synonyms.</p>\n<p>This type of profile is a lot less useful for applying to a fixed-term position, however.</p>\n" }, { "answer_id": 171516, "author": "engineer", "author_id": 125369, "author_profile": "https://workplace.stackexchange.com/users/125369", "pm_score": 1, "selected": false, "text": "<h2>TLDR;</h2>\n<p>The <strong>combination</strong> style resume is good. It emphasizes your skills, like you want. If a hierarchy format can be made to look clean and concise, it could be one way of doing the skills (foremost and top) section of a combination resume.</p>\n<p>A <strong>functional</strong> resume also could do this, but lacks the list of jobs, so a largely-functional, but combination, resume, is best in my opinion.</p>\n<h2>Detailed information</h2>\n<p>The US Department of Labor has an <a href=\"https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Participant-Guide.pdf\" rel=\"nofollow noreferrer\">excellent handbook</a> which can help you write a nice, <strong>Functional (skill-based)</strong> or <strong>Combination (Time &amp; Skill Based)</strong> resume. This handbook is commonly used for training military veterans who are transitioning out of the military and into the civilian workforce how to write resumes and focus on their skills.</p>\n<p>The standard resume format is the <strong>Chronological (Time Based)</strong> resume. The <strong>Chronological</strong> resume is excellent for those working at great companies and in their desired skillset their whole careers, but it does very poorly for those who build their skills in their free time (self learners), those who are making career transitions (ex: military to software developers), or those who have otherwise non-standard career histories.</p>\n<p>Therefore, when emphasizing skill is desired and/or you are making a major career change, the <strong>Functional</strong> (ok) or <strong>Combination</strong> (I recommend this one!) resume may be highly-effective and highly-desirable.</p>\n<p><em>The 3 resume types: Chronological, Combination, Functional:</em>\n<a href=\"https://i.stack.imgur.com/PYkDP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/PYkDP.jpg\" alt=\"enter image description here\" /></a></p>\n<p>The problem with the <strong>Functional</strong> resume is that it leaves recruiters wondering, &quot;well, where did this person work in the past and what did they do?&quot; This can turn them off, so, I recommend the <strong>Combination</strong> resume. Essentially, you put all your skills you care about and <em>which matter to your potential employer you are applying to</em> up front, then you place a brief and concise list of employers at the end, with dates and locations and titles, 1 or 2 lines max per role. This way, the bulk of your resume and focus becomes your skills, while your previous work history is an after-thought--just there to prove you were employed and doing something useful at all. Behind each skill you list at the top of the resume should be a description and/or list of projects which support this skill.</p>\n<p>Here is an example of a Combination resume from pg 80 of the guide: <a href=\"https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Participant-Guide.pdf\" rel=\"nofollow noreferrer\">https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Participant-Guide.pdf</a>:\n<a href=\"https://i.stack.imgur.com/VbM4V.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/VbM4V.png\" alt=\"enter image description here\" /></a></p>\n<p>There are many ways to style this resume, but again, I highly-highly recommend it when you need to emphasize skills over job history!</p>\n<h2>Anecdotal evidence and personal experience with the Combination style resume</h2>\n<p>After 8 yrs in the military I used a <strong>combination</strong> resume to get a job (with great difficulty, mind you, and some help and referrals) at a top tech company in San Francisco...as an embedded software developer. I had very little software development experience in my military role, but tons in my personal and hobby experience, which I had been doing for years, as able, outside my &quot;day job&quot;, and mostly self-taught. My last couple military assignments were so non-applicable to my job I wanted they each got 1 single line on my whole resume, despite taking multiple years of my life.</p>\n<blockquote>\n<p>Considerig that I am breaking the convention but also considering that I want to weed out conservative employers who do not appreciate doing thing innovatively, is this a good idea?</p>\n</blockquote>\n<p>This (using a <strong>combination</strong> or <strong>functional</strong> style resume) is <em>definitely</em> breaking convention. I can tell you that the closer the companies were to the US government, military, or Department of Defense, the less-likely they were to take me seriously as a software developer. They largely ignored me. Several of their recruiters even told me my several <em>thousand</em> hours of impressive hobby and side projects (some paid) &quot;didn't count&quot;, because they weren't for a major company as part of my &quot;day job.&quot; These were what I consider the &quot;non-innovative&quot; companies. It was okay in the end they rejected me, as I would not have been happy working for them either.</p>\n<p>BUT, the Googles, Facebooks, and other, smaller but equally prestigious high tech companies looked at my <strong>Combination resume</strong>, with a list of skills, projects, GitHub links, links to YouTube videos I made, my website, projects I completed, etc. etc., and they <em>were intrigued.</em> They gave me a chance, and I got <em>on-site</em> interviews at many of them. Eventually, I filled in the skill and interview gaps, figured out what &quot;algorithms&quot; meant to the common software world, studied them, and got a job which required 7 white-board interviews, each testing a different skillset I listed on my resume to see if I was &quot;for real.&quot; They hired me. It's been brutally difficult to get there, to stay there, and to continue progressing, but the <strong>Combination</strong> style resume, where <em>skills</em> and NOT employers or titles were the key focus of the resume, <strong>was a key part of</strong> this success, <em>especially</em> to get into my first job in the industry in the San Francisco Bay Area.</p>\n<p>Ever since getting that first job now, I no longer have the problems I used to have getting companies to take me seriously. Even the &quot;non-innovative&quot; companies like the Dept. of Defense contractors and recruiters who previously rejected me for being non-conventional and not having a degree in software, now regularly contact me because they see my companies on my LinkedIn profile and resume now. I still use the <strong>combination</strong> style resume, however, because my list of skills is still far longer than my list of impressive companies, and if they want to see my companies they can look at LinkedIn anyway, and because it helps me target positions easier when I target my resume and list of skills to the specific job application rather than just listing all the stuff I had to do too which I don't ever want to do again.</p>\n<p>Last note: when applying for your job you want, don't list all the skills you have, list <em>just those skills which will help you get the job you want.</em> Ex: I'm pretty good in making PowerPoint presentations and giving inane briefings, but <em>I hate doing that.</em> <em>No amount of money can pay me to do that again</em>, so I leave it off. If you want to do some specific thing, make that and those skills your primary focus. The <strong>combination</strong> resume helps you do this.</p>\n<h2>Resources:</h2>\n<ol>\n<li>Slides: <a href=\"https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Presentation.pdf\" rel=\"nofollow noreferrer\">https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Presentation.pdf</a></li>\n<li>Manual: <a href=\"https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Participant-Guide.pdf\" rel=\"nofollow noreferrer\">https://www.dol.gov/sites/dolgov/files/VETS/files/TAP-EFCT-Participant-Guide.pdf</a></li>\n</ol>\n<p>Screenshot of some of the slides:\n<a href=\"https://i.stack.imgur.com/3QXMl.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/3QXMl.jpg\" alt=\"enter image description here\" /></a></p>\n" }, { "answer_id": 171592, "author": "SquiddleXO", "author_id": 81560, "author_profile": "https://workplace.stackexchange.com/users/81560", "pm_score": 0, "selected": false, "text": "<p>The problem with just listing skills is that there is no way for the employer to know:</p>\n<ul>\n<li>Your level of knowledge in that skill</li>\n<li>What you consider &quot;knowing&quot; that skill</li>\n<li>Whether you're lying</li>\n</ul>\n<p>People list experience as a way of solving these problems. Tradesmen also do it by way of reviews, testimonials and references. But unlike tradesmen, it is much more effortful and costly to deal with a bad hire, and there are also many more candidates to choose from.</p>\n<p>Interviewing takes a lot of time and work so hiring managers want to avoid interviews that turn out to be poor candidates. Someone who lists a skill along with detailed experience relevant to that skill will probably interview well about that skill. Someone who merely lists the skill may in fact have it and interview well, or they may be lying or confused about the skill and interview poorly. So the guy with experience listed will get interviewed before the guy who only lists the skill.</p>\n<p>Also, your tree format wastes a lot of space. When people list skills, they usually condense it into an in-line list so that the entire skills section is only a few lines. That way you have room on your resume for both skills and other things.</p>\n<blockquote>\n<p>My aspiration is to market myself as a contractor who comes in, does the job, and leaves</p>\n</blockquote>\n<p>If you want to be a contractor, you should create an LLC for yourself and approach companies with your consulting rates and pitch. This is a whole different ball game from being a salaried employee and resumes are not really applicable to it.</p>\n" } ]
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 own the knowledgebase, the group does. There is no disrespect involved and if you feel there is, then you need to look to your own attitude. </p>\n\n<p>If someone revises your contribution and you feel they have changed the meaning, then revise it again. However, do not use the same words as clearly they were unclear to begin with or the other person would not have misinterpreted them.</p>\n\n<p>The point is the contributions ARE NOT yours any more than the code you write is yours.</p>\n" }, { "answer_id": 8753, "author": "Raye Keslensky", "author_id": 5086, "author_profile": "https://workplace.stackexchange.com/users/5086", "pm_score": 6, "selected": false, "text": "<p><strong>The point of maintaining a knowledge base is to spread knowledge,</strong> 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.</p>\n\n<p>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)?</p>\n\n<p>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. </p>\n\n<p>You don't need people to stop editing -- <strong>you need to create an atmosphere that encourages collective ownership</strong> 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.</p>\n\n<p>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. <em>the purpose of the knowledgebase in the first place</em> -- is the highest quality it can be. </p>\n" }, { "answer_id": 8754, "author": "Jeanne Boyarsky", "author_id": 1512, "author_profile": "https://workplace.stackexchange.com/users/1512", "pm_score": 3, "selected": false, "text": "<p>It's not YOUR page on the knowledge base. It is the company's. Just like a wiki - many people edit the same page and nobody owns it. You used the word \"owner\" in your question. What makes you the owner? The fact that you wrote the answer first? </p>\n\n<p>You don't want to get in an \"edit war\" with someone. If you feel the meaning has changed, talk to the person so you can come to an understanding on what the content should be.</p>\n" }, { "answer_id": 8755, "author": "Dibstar", "author_id": 3165, "author_profile": "https://workplace.stackexchange.com/users/3165", "pm_score": 4, "selected": false, "text": "<p>A knowledge base exists for the benefit of an organisation beyond any one individual. A continuous process of refining (and editing) allows for that knowledge to be improved over time by other members of the organisation.</p>\n\n<p>Sensitivity towards edits would suggest colleagues feeling ownership of the knowledge which is simply not true, and is counter-productive in terms of the overall purpose of the base in the first place.</p>\n\n<p>I also think that <a href=\"https://workplace.stackexchange.com/questions/5672/how-can-you-fix-someone-elses-work-without-seeming-pretentious-mean-or-arroga/5675#5675\">this question</a> addresses some of the root concerns quite well.</p>\n" }, { "answer_id": 8757, "author": "David Robinson", "author_id": 2954, "author_profile": "https://workplace.stackexchange.com/users/2954", "pm_score": 5, "selected": false, "text": "<p>This sounds like a problem with the knowledge base software. Any knowledge base with the ability to edit other user's content should preserve the edit history (like, for example, Stack Exchange and Wikipedia do, or like version control software does). This preserves accountability, and could even become important in legal workplace issues (for example, what if one user edits another's comment to contain harrassment?)</p>\n\n<p>If you're truly sure your software doesn't maintain any kind of edit history (similar to how Stack Exchange has an \"edited X mins ago\" link under each post), it's time to choose new software. (There's even a whole list of <a href=\"https://meta.stackexchange.com/questions/2267/stack-overflow-clones\">Stack Exchange clones</a>, one of which might be appropriate).</p>\n" }, { "answer_id": 8758, "author": "enderland", "author_id": 2322, "author_profile": "https://workplace.stackexchange.com/users/2322", "pm_score": 4, "selected": false, "text": "<blockquote>\n <p>So, how do can I ask politely and professionally ask editors to stop editing without hurting their feelings?</p>\n</blockquote>\n\n<p>Other answers discuss why allowing collective editing is a good idea.</p>\n\n<p>Some practical ways to avoid hurt feelings:</p>\n\n<ol>\n<li>Add some sort of \"revision\" history so you can always see who changes what (basically how Stack&nbsp;Exchange works)</li>\n<li>Add a \"change reason\" description so whenever someone modifies existing text they must give a reason.</li>\n<li>Clearly communicate the reasons for why collective editing exists to the entire team.</li>\n<li>Clearly communicate the standards for what is appropriate. Are jokes appropriate? Are non-technical terms appropriate? etc.</li>\n</ol>\n\n<p>Most tools which allow collective editing should have functionality to do #1 and #2. </p>\n\n<p>If yours doesn't, find software which does.</p>\n" }, { "answer_id": 8767, "author": "Dino", "author_id": 6067, "author_profile": "https://workplace.stackexchange.com/users/6067", "pm_score": 3, "selected": false, "text": "<p>In general, I believe that allowing people to edit and the knowledge to evolve easily outweighs the potential \"hurt feelings\" which such edits cause.</p>\n\n<p>It seems to me that a knowledge base is a very similar resource to a company as the codebase (assuming a software company for the sake of analogy). For code, having code reviews helps to increase the quality. This could be applied to your case as follows: anybody can make a change, but before it goes live, it has to be reviewed and accepted by one (or more, tune this at will) coworkers. This has a few nice effects:</p>\n\n<ul>\n<li>The original contributor sees that multiple people agree with the change.</li>\n<li>If someone tries to make a change which is only helpful to his personal taste, another coworker might catch this in a \"change review\".</li>\n</ul>\n" }, { "answer_id": 8769, "author": "mightyrick", "author_id": 6068, "author_profile": "https://workplace.stackexchange.com/users/6068", "pm_score": 3, "selected": false, "text": "<p>The simple answer here is moderation. The level of moderation depends on your company. Sometimes, simple peer moderation works fine. Other times, you might need a weekly meeting of contributors to review knowledge base additions/removals/edits. </p>\n\n<p>I would approach your manager, explain the issue, and then suggest the above solution. This does a couple of things. First, it demonstrates that you are being proactive in suggesting continual improvement of your business processes. Secondly, it demonstrates that you are thinking more \"big picture\" instead of just asking for a quick fix to your individual problem. This kind of thing can only benefit you.</p>\n\n<p>The last thing that it does is allows your manager -- who has authority -- to present the new process to the team. He/she can do this without accusing anybody of wrongdoing or hurting their feelings. It can be put into the light of continual improvement -- which is absolutely accurate.</p>\n\n<p>The thing I recommend to people is to always try to think big picture when issues happen. If something counter-productive happens, don't just try to think about how to solve the problem for yourself. Instead, try to also think about what can be done to prevent this issue from happening to others in the future.</p>\n" }, { "answer_id": 8775, "author": "Keith Thompson", "author_id": 237, "author_profile": "https://workplace.stackexchange.com/users/237", "pm_score": 4, "selected": false, "text": "<p>The real problem is not that other people are editing <strong>your</strong> content. The real problem is that the user interface of the knowledge base makes it <em>look</em> like it's <strong>your</strong> content, when in fact it belongs to the company.</p>\n\n<p>If I write an article to my own liking, somebody else makes a change to it that I don't like or that I disagree with, <em>and</em> it still shows me as the sole author, then sure, I'll be annoyed.</p>\n\n<p>But if the top of the article shows, for example, the names of the original author and of everyone else who has edited it, or just doesn't show <em>anyone</em>'s name, or shows the full edit history in an alternate view (something like Stack Exchange's edit history or Wikipedia's \"View history\" page), then I'll be much less concerned about it.</p>\n\n<p>The idea is to make it clear that the knowledge base is a collaborative effort, and that no one person \"owns\" any of it.</p>\n\n<p>On the other hand, if you really want individuals to \"own\" content, and take full blame and/or credit for it, you can configure your knowledge base so that only the original author can edit content. But as Wikipedia and Stack Exchange both show, the collaborative editing model can be extremely effective.</p>\n\n<p>Having said that, there are times when it might be more appropriate to suggest an edit to the original author rather than just making it yourself. For example, if you see a problem but you're not sure just how it should be corrected, it's probably a good idea to talk it over; here on Stack Exchange, we do that by posting comments. And if you find yourself in an \"edit war\", with two editors alternately reverting each other's changes, then you should definitely get together with the other person, or if necessary escalate the issue to management (on Stack Exchange, moderators play that role).</p>\n\n<p>Collaborative editing is a powerful tool. Direct editing of content is a good way to achieve that, but it's not the only way.</p>\n" }, { "answer_id": 8780, "author": "user3490", "author_id": 4676, "author_profile": "https://workplace.stackexchange.com/users/4676", "pm_score": 2, "selected": false, "text": "<p>Moderation, as others here have mentioned, is one option, and can help with individual disputes over entries. However, if you don't already have one, consider drawing up a style guide - a set of mutually agreed principles and guidelines for contributions.</p>\n\n<p>These are an important part of many wikis and help contributors achieve a degree of standardisation. It doesn't have to be as long or as detailed as Wikipedia's <a href=\"http://en.wikipedia.org/wiki/Wikipedia%3aManual_of_Style\" rel=\"nofollow\">Manual of Style</a> - even a few basic guidelines can go a long way. If you already have one, consider expanding it, or if your knowledge base is very large perhaps even create separate ones for different types of contributions.</p>\n\n<p>This will help people avoid making edits that are likely to be overridden.</p>\n" }, { "answer_id": 8783, "author": "Dominic Cronin", "author_id": 4807, "author_profile": "https://workplace.stackexchange.com/users/4807", "pm_score": 3, "selected": false, "text": "<p>If your intention is that the knowledge base should be owned and maintained by the group, then the ability to edit and update existing content is paramount. There are two obvious problems you are facing. 1) The edited text remains incorrectly attributed to the original author, and 2) Some people may not appreciate that someone's edit of their writing is an improvement. </p>\n\n<p>Many of these issues were faced early in the days of wikis, and the discussion around them is preserved (or rather, still active) at the very first wiki. A good starting point to visit might be <a href=\"http://c2.com/cgi/wiki?RefactorWhileRespectingSignatures\">RefactorWhleRespectingSignatures</a>. </p>\n\n<p>There's a lot of useful material there and in the nearby pages that might help you to facilitate a suitable discussion with your team on how to work together better.</p>\n\n<p>Regarding the second point: that someone may not like the edit of their writing; they always have the possibility of reverting the change or making their own clarification or improvement. Collaborative ownership of this kind is something that takes getting used to. It helps if everyone is open about the guiding principles that they expect each other to follow.</p>\n" }, { "answer_id": 8787, "author": "Agent_L", "author_id": 6120, "author_profile": "https://workplace.stackexchange.com/users/6120", "pm_score": -1, "selected": false, "text": "<p>The root of the problem is using a forum software but treating it like a wiki. Both approaches are great, but not misrepresenting one as another. Remove edit privileges or remove authors names. As about exact answer to your question: <strong>Remind users that your KB is \"forum\" not a \"wiki\" and should be treated as such.</strong> But ofc changing the software or just tweaking it is a better solution.</p>\n\n<p>As others pointed out, the authors and readers are lead to believe that posts are actual statements made by authors, while they're not. It's absolutely normal people are upset - your knowledge base is based on a lie.</p>\n\n<p>Imagine that someone would edit Satoshi44's \"and pray\" into \"and bang CEO's husband/wife\". Or plain childish \"I'm (insert sexual orientation here)\". Your employees have already displayed a great deal of responsibility and politeness to refrain from such pranks. Edit history would only make persecution easier, but the problem is putting words into someone's mouth.</p>\n\n<p>If I'd work at your company, I'd just edit all posts to something very, very offensive and then send a mail to all \"I've found a bug in our KB and took the effort to demonstrate it. You're welcomed.\".</p>\n\n<p>Edit: I feel I'm being misunderstood. I am not proposing OP to take any drastic actions, I'm merely presenting worse scenarios than those happening now. As arguments to present superiors when discussing the need changing current software.</p>\n\n<p>There is still worse scenario than the board turning into 4chan: One edit would eventually hurt Satoshi44's feelings so much, he'll file a lawsuit for damages for defamation because company publishes posts representing someone other's opinions and falsely claim them to be his. </p>\n" }, { "answer_id": 8800, "author": "gotta have my pops", "author_id": 5827, "author_profile": "https://workplace.stackexchange.com/users/5827", "pm_score": -1, "selected": false, "text": "<p>Why is there a confusion in the accepted style of answer in the first place?</p>\n\n<p>Perhaps there should be a list of guidelines posted somewhere about what is acceptable and what isn't. I don't know what the culture of your company is, but as an example, my company's culture is very relaxed and casual, so jokes are acceptable in our wiki's (I work the tech startup group of a large tech company, so I disagree with other answerers forcing their company culture on others, as that is definitely not the overall attitude here and at most places). But since there seems to be a confusion in your company, perhaps it should be outlined.</p>\n\n<p>And yes, it is rude to edit other people's work. I thought that goes without saying. So, I disagree with HLGEM that someone changing your code is just dandy. That is a huge <strong>taboo</strong> here. You don't change someone else's code without a review with the original author given with an explanation.</p>\n\n<p>Of course, depending on your company culture, the action is probably different. But I think the course of action should be, outline what is accepted, and take away edit rights to edit other people's posts. If someone wants to edit something, they would propose the edit to the original author, and it would be up to the original author to accept or reject it, and given a fair reason, i.e. having been offended by the joke, I'm sure more often than not, the original author would not press to keep a joke that offends someone. If the editor has an issue with the original author's decision, then it will be escalated to the rest of the working group, otherwise, just drop it. I believe this is the most fair way of going about it.</p>\n\n<p>And of course, if this were a client facing FAQ rather than an internal wiki, ground rules about acceptable answers should have been set in the first place.</p>\n" } ]
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, frameworks or other tools. Moreover new tools are easy to pick (if you understand the concepts), but new concepts might not be. Also your \"technical expertise\" as listed in the question tells me nothing about whether or not you understand sockets, for example. On the other hand, I do not really care that much if you have officially worked on something or not, as long as you know what you are talking about and can show that in an interview.</p>\n" }, { "answer_id": 9221, "author": "Dimitrios Mistriotis", "author_id": 3133, "author_profile": "https://workplace.stackexchange.com/users/3133", "pm_score": 2, "selected": false, "text": "<p>I agree that they should be placed, in order to demonstrate on what you were working on, as well as to help people or automated tools that search for someone that knows Unit Testing (for example).</p>\n\n<p>In my opinion the skills should not be too vague (such as \"Object Oriented programming\", \"Java\") so that there won't be the impression that they are there in order to inflate the CV with extra buzzwords.</p>\n\n<p>Best place to put them, would be within the description of the job position and the work being done there.</p>\n" }, { "answer_id": 9225, "author": "Affable Geek", "author_id": 33, "author_profile": "https://workplace.stackexchange.com/users/33", "pm_score": 1, "selected": false, "text": "<p>Remember that your resume will probably find its way past a parser at some point. As such, adding a section like this - and making it as complete as possible - is only a help to you! Obviously, if you include a \"buzzword\" you should be able to back it up in an interview, but including the concept on the resume prevents the parser from denying you that interview in the first place.</p>\n" }, { "answer_id": 9232, "author": "k3b", "author_id": 269, "author_profile": "https://workplace.stackexchange.com/users/269", "pm_score": 0, "selected": false, "text": "<p>Its a great idea to add concepts and i will add these, too in future .</p>\n\n<p>In Germany a resumee should not be longer than one page. </p>\n\n<p>Therefore i have an extra document \"skills and experience\" where i put platforms, languages, concepts .... Over the time this document has grown to 6 pages.</p>\n\n<p>The person reading the resumee can decide himself if he wants to read this extra document or not.</p>\n\n<p>If i apply for a new customer i remove the stuff from this document, that ist not important and/or outdated (z80/6502 assembler, programming dos2.0)</p>\n" }, { "answer_id": 9233, "author": "bethlakshmi", "author_id": 67, "author_profile": "https://workplace.stackexchange.com/users/67", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n\n<p>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:</p>\n\n<ul>\n<li>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. </li>\n<li>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 <em>whiz</em> 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.</li>\n<li>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.</li>\n</ul>\n\n<p>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.</p>\n\n<p>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:</p>\n\n<pre><code>Technical Expertise:\n\nLanguages &amp; Frameworks: C, C++, Qt\nDevelopment tools: GCC, GDB, Valgrind, SVN\nOS: Linux (OpenSUSE)\nConcepts:: UML, Design patterns, Socket programming, Data structures\n</code></pre>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n" } ]
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 &amp; 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 and could have varying levels of skill.</p>\n\n<p>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.</p>\n\n<p>Proficiencies would be a more formalized term if you wanted something a bit more exotic than experience.</p>\n" }, { "answer_id": 9251, "author": "Neuro", "author_id": 1698, "author_profile": "https://workplace.stackexchange.com/users/1698", "pm_score": 2, "selected": false, "text": "<p>No the original heading is fine. I think your over thinking this in English \"expertize\" (or expertise if you don't use the OED) can also mean \"Skill or knowledge in a particular area\" - This is the sense that it is always used in CV's and resumes.</p>\n\n<p>I might say I have expertize in TCP/IP doesn't meant that I am claiming CCIE level understanding </p>\n" }, { "answer_id": 9377, "author": "fecak", "author_id": 2267, "author_profile": "https://workplace.stackexchange.com/users/2267", "pm_score": 1, "selected": false, "text": "<p>Technical recruiter here that has seen many thousands of resumes, and I've never seen \"Technical Expertise\" used on a resume (I'm in the US). The most accepted sections for that title would be either \"Skills\", \"Technical Skills\", \"Technologies\", or \"Technical Experience\".</p>\n" } ]
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-dive intimacy with that technology.\nState the number of years you have been working with a particular technology, and limit the scope in your description.\nFor example:</p>\n\n<blockquote>\n <p>2 years VMWare occasional installation/support.</p>\n</blockquote>\n\n<p>Your resume must get you an interview. After that you will have the opportunity explain all of your experience. Never lie. Always listen with focus and care.</p>\n" }, { "answer_id": 9620, "author": "Nicole", "author_id": 17, "author_profile": "https://workplace.stackexchange.com/users/17", "pm_score": 2, "selected": false, "text": "<p>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 <a href=\"https://workplace.stackexchange.com/questions/1478/how-can-i-overcome-years-of-experience-requirements-when-applying-to-positions\">How can I overcome &quot;years of experience&quot; requirements when applying to positions?</a>.</p>\n<p>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 <em>you</em> need to do something about it. I think that anything you can do will fall into one of three areas:</p>\n<ol>\n<li><strong>Improve perceptions without lying (improve your resume)</strong>.</li>\n<li><strong>Improve your skills</strong>.</li>\n<li><strong>Adjust your expectations</strong>.</li>\n</ol>\n<h2>Improve perceptions</h2>\n<p>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 <em>have been</em>, rewrite it with a focus <strong>on the skills that have prepared you for who you want to be</strong>.</p>\n<p>Remember; integrity is of high importance in the job search process. Make sure you can back up what you say. It may not be &quot;as good&quot; as you wish it was, but that is where parts <strong>#2</strong> and <strong>#3</strong> come in.</p>\n<h2>Improve your skills</h2>\n<p>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.</p>\n<ul>\n<li>Get Microsoft certified</li>\n<li>Run your own Windows Server, including mail, for personal use.</li>\n<li>Participate in MS/Windows/Exchange help forums until you are good enough to be giving the answers. <strong>This will teach you what you do not know, which may be key to #3</strong>.</li>\n</ul>\n<h2>Adjust your expectations</h2>\n<p>First the good news. I think you will find from reading around here and other places that &quot;X years working <strong>with</strong> [technology]&quot; 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).</p>\n<p>But here's the finer detail: The second bullet point does not use the word <em>with</em>, and it's not about a technology. It is a job title and it uses the word <strong>as</strong>. Sometimes, a company wants someone who's done <em><strong>that</strong></em> 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. <strong>I suspect it's much more difficult to get around the &quot;Y years work <em>as</em> [job title]</strong>. This is an objective filter that they want or they wouldn't have listed it.</p>\n<p>Why? Have you heard of the <a href=\"http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect\" rel=\"nofollow noreferrer\">Dunning-Kruger effect</a>? 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 <em>acting as a problem-solver in that role</em> cannot perceive these layers of difficulty.</p>\n<p>See also:</p>\n<ul>\n<li><a href=\"http://en.wikipedia.org/wiki/Four_stages_of_competence\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/Four_stages_of_competence</a></li>\n<li><a href=\"http://explorativeapproach.com/fools-plight-the-dunning-kruger-effect/\" rel=\"nofollow noreferrer\">http://explorativeapproach.com/fools-plight-the-dunning-kruger-effect/</a></li>\n</ul>\n<p>The latter link also includes this fantastic chart illustrating this effect:</p>\n<p><img src=\"https://i.stack.imgur.com/El3qD.jpg\" alt=\"enter image description here\" /></p>\n<p>Don't take this too harshly; it sounds like you have great skills in <em>related areas</em> 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:</p>\n<ul>\n<li><em>Most Linux concepts about things such as DNS apply to Windows.</em></li>\n<li><em>Windows is very &quot;point and click&quot;.</em></li>\n<li><em>It is all point and click and can be learned in an hour.</em></li>\n</ul>\n<p>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.</p>\n<h2>Summary</h2>\n<p>Here's the most important point. <strong>If you want to change tracks, expect to take a couple steps back.</strong> Don't let your expertise in one field to fool you into thinking you are already an expert in another; instead, let it <strong>inform</strong> your learning in the new area and give you a head start.</p>\n<p>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.</p>\n" } ]
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: ![enter image description here](https://i.stack.imgur.com/El3qD.jpg) 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</blockquote>\n\n<p>Above is a huge red flag, don't do this.</p>\n\n<p>If it's <em>really</em> 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 <strong>work hours</strong>, 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 <em>is</em> work) can lead to productivity losses, as explained eg in <a href=\"http://www.alternet.org/story/154518/why_we_have_to_go_back_to_a_40-hour_work_week_to_keep_our_sanity\">Why We Have to Go Back to a 40-Hour Work Week to Keep Our Sanity</a>:</p>\n\n<blockquote>\n <p>...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. </p>\n</blockquote>\n\n<p>If it's <em>really</em> 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 <strong>work hours</strong> accordingly.</p>\n\n<ul>\n<li>Allocating <strong>work hours</strong> 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 <em>artificial self-motivation</em> 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).</li>\n</ul>\n\n<hr>\n\n<p>Generally, one better be careful about incentives to <em>free hours</em> activities. Just imagine...</p>\n\n<pre><code>- [company] We will pay $1000 if you pass OCJCMC-AC/DC\n certification in your free time.\n- [employee] Wow great I'll go for it!\n\n --- 2-3 months later... ---\n\n- [company] We'll cut your bonus by $2000 because you failed project X.\n- [employee] Oh but... but I was in bad shape because I spent\n much effort preparing for certification.\n- [company] Oops.\n- [employee] WTF?!\n</code></pre>\n\n<p>This can kill any motivation faster than you say \"Oops\".</p>\n" }, { "answer_id": 9662, "author": "GreenMatt", "author_id": 2317, "author_profile": "https://workplace.stackexchange.com/users/2317", "pm_score": 5, "selected": false, "text": "<p>You say you're already providing study materials and covering the exam costs, which is a good start. As <a href=\"https://workplace.stackexchange.com/a/9660/2317\">gnat's answer</a> says, provide them paid time to study, since it is in the company's interest.</p>\n\n<p>A suggestion based on a successful experience of my own - make it social by organizing group study sessions. Several years ago my employer decided they wanted more people to obtain a certain certification. They organized lunch time study sessions for any employee who wanted to attend. This included buying lunch (pizza, sandwiches, etc.). We picked an appropriate book and worked our way through it. Each person took a turn presenting a topic out of the book. After completing the book and wrapping up the study sessions, I heard that about half the attendees took the certification exam and all who took it passed.</p>\n\n<p>The social aspect can engage people in ways that a solitary study process will not: They may just enjoy the interacting with other employees; they may learn better by discussing the subject in a group; they may get a friendly competition going, or they may like the networking possibilities. I found that I enjoyed the process more due to all of these factors. As suggested in the comments, this should be voluntary.</p>\n" }, { "answer_id": 9666, "author": "Nilzor", "author_id": 7754, "author_profile": "https://workplace.stackexchange.com/users/7754", "pm_score": 2, "selected": false, "text": "<p>If $500 isn't enough, raise the price until it is. I believe this is the only way to go. </p>\n\n<p>My former company had a bonus of ~$1300 for each certification - and it worked. Then again, we didn't spend 60 hours on each. More like 20 (Microsoft certificates).</p>\n" }, { "answer_id": 9667, "author": "Dan Is Fiddling By Firelight", "author_id": 345, "author_profile": "https://workplace.stackexchange.com/users/345", "pm_score": 4, "selected": false, "text": "<p>The problem you might be running into is that because so many programming certificates can be easily acquired by cheating, many developers view them as utterly worthless as a way to demonstrate competence.</p>\n\n<p>If that's the case any carrot approaches to get people to earn them off the clock are likely to fail because the certs are seen as a waste of time. Instead you might be forced to apply the stick in a heavy handed manner by making earning certificate X by date Y a condition for continued employment. </p>\n\n<p>The main thing you need to be aware of and plan for with this approach is that if your target group is larger than a few people you'll probably have some who decide they'd rather quit than waste their time on earning a piece of paper they consider worthless. </p>\n\n<p>There are less heavy handed ways to use the stick like giving employee's with certs preference for plum assignments or retention during a staffing cut; but they'll all end up with a similar end result even if they take longer to get there. </p>\n\n<p>Employee's who like certs will get them without complaining; but they probably already had them from before you made it an issue. Good employee's who like their job enough to treat the cert requirement as just one of the ways their current job is less than perfect will grumble and take a morale hit but get them anyway. Poor employees will get the certs even if they think they're worthless because they know they'd have trouble getting a new job if they lose this one. Good employees who think certs are worthless and aren't willing to keep wasting their time earning and maintaining them will leave. Some of the last group might get the initial certs but only because they want to avoid the financial strain that would come from losing their current job before they had a replacement lined up; but they'll still leave asap.</p>\n\n<p>If you current and potential customers value having the contractors they're hiring being certified sufficiently that it allows you to raise the rate at which you're billing them by a non-trivial amount or significantly increase the percentage of new contracts you win the hit you take with current employee's might be worth taking. At the same time, if you can charge an extra $10-30/hour by providing people with certificates passing a larger chunk of that on may ease discontent. Someone who turns his nose up at spending 50 hours for a $500 bonus may change his mind at being paid an extra $5k/year over and above the expected annual raise.</p>\n" }, { "answer_id": 9682, "author": "JAGAnalyst", "author_id": 5272, "author_profile": "https://workplace.stackexchange.com/users/5272", "pm_score": 2, "selected": false, "text": "<p>In financial services there is a similar dynamic where service providers or consulting firms want to be able to say that a high percentage of their associates have a terminal degree or level of certification in their field, such as a CPA or MBA. Even when the employee already has all of the relevant knowledge and there will be no change in the actual service provided, it increases the firm's ability to sell its services. </p>\n\n<p>If this allows the firm to increase its volume or rates, the employees who are willing to put in the extra effort to achieve certifications the company deems valuable should share in the benefits accrued company in a significant and permanent way.</p>\n\n<p>If you need a high level of participation simply to compete or survive in your industry, you may need to make certification within a certain timeframe a condition of employment or advancement. If this is the case, you are really changing the nature of the job itself which is always difficult. Unless you intend to fire those who don't get certified, you have to create a compelling reason for employees to do additional work on their own time.</p>\n\n<p>Some options you could try include:</p>\n\n<p>1) Offer a limited number of special \"Paid Time Off\" days to employees to study. Many companies like mine who have a vested interest in community involvement or other activities use these types of programs. However, they typically reward people who already want to do these things, rather than inducing those who were not already interested to participate.</p>\n\n<p>2) Create role-specific requirements that reflect the company's ability to earn. For example, salary bands are often capped. However, you could raise the cap for employees with certain certifications, or say that one must have certifications X, Y, and Z to become a program manager or tech lead. Unlike denying a higher annual raise based on certification, this gives the employee a choice: I can make up to $X without the cert, or up to $Y with the cert, and either will be OK with management because it reflects the difference in what the company can make from the employee. Again, the key is what the company can earn rather than what the employee can produce.</p>\n\n<p>3) Hold an instructor-led exam prep class on-site. This could be a voluntary offering during \"lunch\" hours, which is often perceived as less intrusive, or could be full-time training for those not on projects at the time.</p>\n\n<p>4) Offer additional non-financial benefits. Many corporate resources, such as training budgets or formal mentoring opportunities are often scarce by nature, forcing the company to allocate them. You can choose to put employees who pursue certs at the top of the list for things like first preference in project assignments, job rotation, mentoring opportunities, or opportunities in emerging technologies. This can be valuable to someone who wants to move into management, change roles, or learn how to work with \"the hot new thing\".</p>\n\n<p>5) Clarify which certs you value most. If it's \"everything\", and the list changes every six months, people will feel they will never be able to stay current.</p>\n\n<p>6) Professional status. This is much harder, but ultimately you can create a culture that communicates that you value certification. That's who we hire. That's who we promote. That's who has influence around here. However, you have to accept that a certain number of people will not fit this culture and will leave or become dissatisfied.</p>\n\n<p>I would also question whether employees currently on projects need to study at the same time. Do you really want them splitting their (finite) energy between clients and studying? It may be preferable to encourage or require them to study in a more intensely focused way the next time they have \"free\" time.</p>\n\n<p>Best of luck!</p>\n" }, { "answer_id": 9683, "author": "Doltknuckle", "author_id": 7769, "author_profile": "https://workplace.stackexchange.com/users/7769", "pm_score": 2, "selected": false, "text": "<p>You might take a page from the education sector and setup a structured learning program. From what I have seen and experienced, people respond well to deadlines and project milestones. Break apart the larger certificates into small learning targets that an employee can demonstrate mastery in a few hours. String enough of them together and you can create a curriculum sequence that ends with a high enough mastery to get the certificate.</p>\n\n<p>Incentives can be tricky to set properly. Often, when presented an incentive, people act in a way that is unexpected and counterproductive to the result that you want. I would check out [Freakonomics][1]. It's a book, blog, and podcast that talk a lot about incentives and how people react to them. There are many different incentives that you can setup, and picking the right one depends on your workers and culture. An incentive that works in one company is completely out of place in another.</p>\n\n<p>Let's look at some of the common incentives that you may come up with.</p>\n\n<p><strong>Financial Incentives</strong></p>\n\n<p>This is by far the most common that people think of when they talk about incentives. Giving bonuses or increasing someone's pay can work to entice those who place a high value on wealth. Your more materialistic employees will be more likely to respond to this incentive. People who are able to live comfortably with their current wage are more likely to ignore this opportunity.</p>\n\n<p><strong>Scheduling Incentives</strong></p>\n\n<p>This is where you use a person’s work schedule as an incentive. You can use anything like work hours to study, or extra days off for meeting a goal. It could be even something simple like allowing them to have a more flexible schedule. This is a really powerful incentive for those who value their own time. Those who don't have a lot of free time are more likely to respond. Workaholics who love being at work all day will probably ignore this one.</p>\n\n<p><strong>Emotional Incentives</strong></p>\n\n<p>There are a lot of people out there that love being recognized for how great they are. Giving out awards, setting up a way for people to brag or compete are all emotional incentives. There is no monetary gain from completing the task, but they may think that their reputation is more important than money. This is great for highly competitive people who love being at the top of a leader board. People who don’t care what others think will ignore this one.</p>\n\n<p><strong>Political Incentives</strong></p>\n\n<p>Workplace politics are often complicated and difficult to change, which makes this one of the more difficult and dangerous incentives. This kind of incentive is one where you offer things like advancement or prominent positions on projects. In your case, you would only give the lead position of a project to someone who has certain certificates. This type of incentive attracts ambitious people to do what you want.</p>\n\n<p>While I’m sure that there are more types of incentives out there, these are just some that I find the most common. Picking the right incentive requires you to understand the person you are trying to influence. There is no golden incentive that works for all people. The question is not really what incentive you should use, but what kind of people do you want to attract. Once you figure out the target, you can work to figure out what is important to them. That should give you a clue as to what kind of incentive would work for them.</p>\n\n<p>Good Luck</p>\n" }, { "answer_id": 9686, "author": "Joe Strazzere", "author_id": 7777, "author_profile": "https://workplace.stackexchange.com/users/7777", "pm_score": 3, "selected": false, "text": "<p>Good answers already. </p>\n\n<p>It's either important to the company, and thus time should be allocated, or it's not.</p>\n\n<p>When you say \"employees would have to study for certificates in their off work hours\" you are basically telling employees that certification isn't really important enough for the company to bother spending time on it.</p>\n\n<p>If you really want people to work on certificates, make it a part of their job. Allocate whatever time you want them to spend on gaining certificates either within their project time, or between projects.</p>\n\n<p>Expecting someone to devote their personal free time to something that helps you attract customers isn't a wise business choice.</p>\n\n<p>While I personally haven't found any value for certifications for myself or my team, whenever I want folks to learn something, I provide the opportunity to do so on company time.</p>\n" }, { "answer_id": 11903, "author": "Bigbio2002", "author_id": 9194, "author_profile": "https://workplace.stackexchange.com/users/9194", "pm_score": 1, "selected": false, "text": "<p>Cash prizes and competition.</p>\n\n<p>My company periodically offers $1,000-2,500 for the first 2-4 employees to complete a certain certification. As others have said, $500 may be too low to seriously motivate someone. Additionally, we're technically required to do some hours of training as part of our jobs anyways, so having to do it outside of work in our free time isn't a strict requirement.</p>\n" } ]
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>\n\n<p>You have several options, and without knowing her (or you), it's difficult to guess which one might work. </p>\n\n<ul>\n<li><p>Get a mediator or a couple's therapist, and work with them to figure out how to proceed. This is a very dicey situation for both your company and your relationship, and approaching it as \"I should fire my wife\" is probably not conducive to a happy marriage during or after ending that business relationship.</p></li>\n<li><p>Just rewrite the front end without her permission (or hire someone to redesign/rewrite the front end). If she's not involved in the day-to-day operations of the business, then she's not going to notice. </p></li>\n<li><p>Come up with an excellent reason for the front-end rewrite, like \"we have to support mobile devices\" or \"we have to do this because our biggest customer has requested it\". And then carry out the rewrite.</p></li>\n<li><p>Help her understand your perspective about the need for the UI rewrite. Share data (or just anecdotes) of business that you have lost as a result of the dated appearance of your application. Share information about changing UI trends. </p></li>\n<li><p>Discuss with her how she sees her role in the company, since she's not currently contributing (or, to put a much more positive spin on it, \"she is focusing her energy elsewhere\"). Get her buy-off that she should formally sever ties with the company so that you can have the flexibility to do what is necessary for the future of your product, and she can continue to focus on whatever it is that she's doing.</p></li>\n</ul>\n\n<p>This situation is going to require a high degree of diplomacy and sensitivity. Best of luck.</p>\n" }, { "answer_id": 10371, "author": "jmac", "author_id": 7945, "author_profile": "https://workplace.stackexchange.com/users/7945", "pm_score": 4, "selected": false, "text": "<h2>Recipe for Disaster</h2>\n\n<p>I cannot emphasize the need for caution, caution, and more caution with the path you're talking about taking. You are playing with fire, and you don't want to get burned. Proceed incredibly carefully, thinking about the worst possible situation (broke, divorced, unemployed, with pissed off ex-customers) before acting.</p>\n\n<h2>Four cups of perspective</h2>\n\n<p>Which is more important, your business or your relationship? That question is at the heart of whatever action you take. Since the two are intertwined, taking action on one will have impact on the other.</p>\n\n<h2>Add two tablespoons of preparation</h2>\n\n<p>Have you discussed this with your wife/partner at length? Have you spoken to your father? Do they understand what your opinion is? Do they have a different suggestion about the direction of the company? Is this something you can find a good compromise for?</p>\n\n<p>Adults have discussions with other adults. Especially business associates and family members. If that isn't possible, you may want to address the core issue first, and then have a discussion about the business. It doesn't sound like the business will go under if you sort out more important issues first.</p>\n\n<h2>Let sit for 15 minutes</h2>\n\n<p>After you know what everyone thinks about the situation, think about the consequences of whatever action you take. To pilfer some of the solutions provided by nadyne:</p>\n\n<blockquote>\n <p>Get a mediator or a couple's therapist, and work with them to figure out how to proceed</p>\n</blockquote>\n\n<p>Realize that your wife may resent you using a therapist to get your way in a business decision. I know I would.</p>\n\n<blockquote>\n <p>Just rewrite the front end without her permission</p>\n</blockquote>\n\n<p>Realize that your wife may resent you acting unilaterally without their consent on the business side. I know I would.</p>\n\n<blockquote>\n <p>Get her buy-off that she should formally sever ties with the company so that you can have the flexibility to do what is necessary for the future of your product</p>\n</blockquote>\n\n<p>Realize that your wife may resent you asserting that this is <strong>your</strong> product/business when she owns 39%. I would too, especially if you had given me 49% of the company when you were of sound mind and body.</p>\n\n<p>The point is that taking unilateral action without the preparation (discussing like adults and removing any barriers to that discussion first if they exist outside the context of this decision) will cause problems in your relationship. No offense, but it isn't really nice to do things unilaterally that impact other adults without consulting them about it first.</p>\n\n<p>If you care about your relationship, which is the first thing you should be considering, it probably isn't a good thing to do not-nice things to your wife.</p>\n\n<h2>Let simmer at impossible heat for several years</h2>\n\n<p>Understanding all the above, and deciding <em><a href=\"http://en.wiktionary.org/wiki/damn_the_torpedoes\">\"Damn the torpedoes, full speed ahead\"</a></em>, realize that this can cause significant long-term issues both maritally, legally, and professionally. Be very sure you carefully review any contracts involving the creation of the company (specifically anything involving buying out partners, dissolution of the company, etc.). Consult with a lawyer (specifically a divorce attorney, to see what happens to the business in the case your spouse decides to be as spiteful as possible, for instance refusing to sell rights in the company and/or fighting to take ownership of the thing as part of the divorce case).</p>\n\n<p><strong>Heed that advice!</strong> The last thing you want to do is to go over your wife's head, make a change she resents, have her screw you over for it, and end up without your wife, without your business, and a bunch of pissed off ex-customers who aren't happy with how it ended up for them.</p>\n\n<p>I can't tell you what decision to make (at the end of the day it is your choice), I can only suggest extreme caution before making it. Think long and hard about how you want your life to end up at the end of this, and make the appropriate decision based on what you discover.</p>\n" }, { "answer_id": 10379, "author": "Kate Gregory", "author_id": 102, "author_profile": "https://workplace.stackexchange.com/users/102", "pm_score": 6, "selected": true, "text": "<p>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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>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?</p>\n\n<p>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.</p>\n" }, { "answer_id": 10380, "author": "Robbie Dee", "author_id": 5035, "author_profile": "https://workplace.stackexchange.com/users/5035", "pm_score": 2, "selected": false, "text": "<p>This is essentially a business problem so IMHO, I'd leave the relationship dynamic out of it. Not saying it has no weight - it just doesn't belong in a reasoned discussion of the problem at hand.</p>\n\n<p>I too am staggered that you want to fire her - she owns a share of the business. She isn't just an employee so AFAIK, this isn't an option.</p>\n\n<p>If she isn't pulling her weight, start pushing more of the admin stuff her way. This isn't supposed to be a sleeping partner arrangement. Yes, you both have a stake in the business, but you're both supposed to be involved in the day-to-day running.</p>\n\n<p>If she wants no further part in it, then fair enough. Discuss this with a view to buying her out.</p>\n" }, { "answer_id": 10401, "author": "voretaq7", "author_id": 164, "author_profile": "https://workplace.stackexchange.com/users/164", "pm_score": 3, "selected": false, "text": "<p>If your wife truly cares about the business then the logical way to work through this impasse is to make a <em>clear business case</em> for your side of things. </p>\n\n<p>You say that in <em>your</em> opinion the UI is extremely outdated -- Do your customers share this opinion?<br>\nIf you don't know what your customers think now is a great time to send them a \"satisfaction survey\" and invite their comments / suggestions.</p>\n\n<p>If your customers would like a site redesign (or sufficient UI changes as to require a redesign) you have a business case for it - if your wife is truly invested in the success of the business she should accept that you need to do what your customers demand.</p>\n\n<p>Of course the door swings both ways -- your customers may LOVE the current site/UI and be totally opposed to changes. If so your wife is right: Rework the back-end all you want, but don't break the UI.</p>\n\n<p>If the customers indicate they want a change but your wife is still adamantly opposed you and your father-in-law can overrule her. (For that matter you hold a controlling stake: <em>YOU</em> can overrule her - though for the sake of marital harmony it's probably better to have \"daddy\" saying you're right. She might still resent you for it, but at least there's someone else to resent too so you're not the only bad guy.)</p>\n\n<hr>\n\n<p>Disclaimer: </p>\n\n<ol>\n<li>I'm not married</li>\n<li>I'm an engineer</li>\n<li>I hate people</li>\n<li>Feelings don't matter to me</li>\n</ol>\n\n<p>I would strongly advise some couples therapy and/or a disinterested third-party mediator with better qualifications than I or a bunch of strangers on a Q&amp;A site to help you work this out if you value marital harmony.<br>\n<sub>(Of course if you hate your wife &amp; don't care if she becomes your ex-wife just tell her to get stuffed - you have the controlling stake.)</sub></p>\n" } ]
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 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:</p>\n\n<ul>\n<li>One job ending in the same or subsequent month the next job begins means you likely left of your own volition.</li>\n<li>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.</li>\n<li>Six months or longer will definitely cause me to ask you to explain the gap.</li>\n</ul>\n\n<p>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.</p>\n\n<p>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.</p>\n" }, { "answer_id": 10413, "author": "Robbie Dee", "author_id": 5035, "author_profile": "https://workplace.stackexchange.com/users/5035", "pm_score": 3, "selected": false, "text": "<p>If I saw a CV that only had years, this wouldn't ring any immediate alarm bells unless there were multiple roles in the same year.</p>\n\n<p>Months are only really relevant for contracting staff where they might reasonably have multiple roles in the same calendar year.</p>\n\n<p>That being said, the majority of CVs I see do mention month and year. One or two have exact dates which isn't really necessary in my view.</p>\n" }, { "answer_id": 10414, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>I don't see any advantage, but that just might be my lack of asthetics. Including the months in a resume/cv is so common, it may bring uncessary attention to an area you're trying to de-emphasize. At best the highering person will ask you to clarify during an initial interview. Otherwise, they may think you're trying to hide something.</p>\n\n<p>I don't think the minimalist approach you're taking is going to make a noticable difference, but everyone appreciates the effort to have a cv that gets to the point. </p>\n" } ]
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>\n<li><p>A is good but suffers if there's a lot of computers around because they block eye contact and also doesn't allow easy access to the desks nearest the window.</p></li>\n<li><p>B is poor, people are isolated, it's harder to get attention and tends to lead to a much quieter office (this might be preferable for some people).</p></li>\n<li><p>C is excellent in my view, it preserves sight lines away from the directly forward focus which will usually be blocked by computers but still gives an easy route to every desk from the main door.</p></li>\n</ol>\n\n<p>It occurs to me that doesn't necessarily immediately answer the question. There is a section on office space and layout in \"Peopleware\" which is an excellent read if you haven't already read it.</p>\n\n<p>I don't have any specific academic papers on it though.</p>\n" }, { "answer_id": 10415, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>Depending on how many people come in the door, it seems like it hinders your productivity.</p>\n\n<p>It's going to boil down to:</p>\n\n<ol>\n<li>Does having your back to the door bother you? Avoid the seats with a blocked view.</li>\n<li>Does facing dirctly at another person distract you? I've never sat face to face in an office without a cube wall that I couldn't see over. Large monitors may be good enough.</li>\n</ol>\n\n<p>It's probably an individual preference. And if your group prefers the isolation all the time, it may hinder the group productivity. Talk to your coworkers about the communication impedance. This is a good thing if interuptions are a problem, but it's bad if everyone is reluctant toa speak to the group when needed. </p>\n\n<p>If you need to have a meeting, have everyone turn around in their chairs away from their computers. Make it quick. Four people talking to each other while working on their computers is good for chit-chat, but not important discussions. Multi-tasking is just a euphemism for not paying attention.</p>\n" }, { "answer_id": 10419, "author": "Deer Hunter", "author_id": 5433, "author_profile": "https://workplace.stackexchange.com/users/5433", "pm_score": 0, "selected": false, "text": "<p>The overarching consideration is maximizing concentration. This means that everybody needs some private space. In addition, there are valuable extra goodies:</p>\n\n<ul>\n<li>being able to see the sky/skyline out of the window</li>\n<li>having clear way of evacuation in case of fire or another emergency (you have to look up local building codes for more information)</li>\n<li>fairness of distribution of all the above-mentioned goodies among co-workers (if there's a boss in there, she/he most likely needs a separate office anyway)</li>\n</ul>\n\n<p>Now, back to the layouts you have drawn:</p>\n\n<p><strong>TL;DR</strong> - B is better than A, A is better than C</p>\n\n<p><strong>WHY?</strong></p>\n\n<p>Sitting face to face with each other (layout A) is not good for concentration if your vis-a-vis is texting, eating, drinking, drawing, or doing anything else.</p>\n\n<p>As Jeff O said, if you need a quick conference in the B layout, people just turn around. Otherwise it is close to ideal. Everybody <strong>can</strong> see people who enter through the door with a slight turn of the head. </p>\n\n<p>The C layout creates two kinds of inequality: folks sitting with their backs to the window (let's call them <code>C3</code> and <code>C4</code>) cannot see the sky without a 180-deg turn, but can (or are made to) observe their colleagues. Of course C is a version of A, so you get less concentration as well. In C, evacuation routes for the <code>C3</code> and <code>C4</code> are worse than for <code>C1</code> and <code>C2</code>.</p>\n\n<p><strong>Peopleware really is recommended reading here!</strong></p>\n\n<p>And a note: for office work you don't have to observe what the others are doing, for co-ordination you can and should communicate verbally instead (or, if concentration requirement is paramount, you can use e-mail and other non-intrusive methods).</p>\n" }, { "answer_id": 10425, "author": "bethlakshmi", "author_id": 67, "author_profile": "https://workplace.stackexchange.com/users/67", "pm_score": 5, "selected": true, "text": "<p>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. </p>\n\n<p>Here's some of the theories I've seen most:</p>\n\n<ul>\n<li><p><strong>Open seating</strong> - 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.</p></li>\n<li><p><strong>Context switch minimization</strong> - 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.</p></li>\n</ul>\n\n<h2>My reality-check based on a few too many management books</h2>\n\n<p><strong>1 - Mixing and matching rarely works</strong> </p>\n\n<p>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?). </p>\n\n<p>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...)</p>\n\n<p><strong>2 - Space trumps all</strong></p>\n\n<p>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.</p>\n\n<p><strong>3 - Equality and Rank are important</strong></p>\n\n<p>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. </p>\n\n<p>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. </p>\n\n<p><strong>4 - No matter what you do, someone will find a way to hate it.</strong></p>\n\n<p>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\".</p>\n\n<p>Also - with any new environment, there's a 1-2 month bake in time where people will be unhappy simply because change = bad.</p>\n\n<p><strong>5 - Corporate culture is an influencer</strong></p>\n\n<p>That doesn't mean that you need to avoid bucking the system. But realize that it's a factor. For example:</p>\n\n<ul>\n<li><p>same old, same old - for this company will get less complaining, and an assumption of \"that's how it is\" conveyed to new people.</p></li>\n<li><p>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.</p></li>\n</ul>\n\n<p><strong>Putting the right people together matters more than the configuration</strong></p>\n\n<p>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. </p>\n\n<p>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.</p>\n" } ]
2013/03/20
[ "https://workplace.stackexchange.com/questions/10411", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7752/" ]
Consider following seating arrangements: A) ![A](https://i.stack.imgur.com/SnBBP.png) B) ![B](https://i.stack.imgur.com/ysbCe.png) C) ![C](https://i.stack.imgur.com/oIF5m.png) ``` **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 websites:</p>\n\n<pre><code>Adds\nMoves\nChanges\n</code></pre>\n\n<p>Of course alot of us learn by experience in the freelance field, but if he wants to change <em>the entire look of the website</em>, then that is by definition a new site, even if it's still <code>myfriendswebsite.com</code>. It may take some convincing and examples of what would fall under the Adds Moves &amp; Changes categories and what would not, but ultimately it's up to the customer to continue to do business with you or not. </p>\n\n<p>With my own website clients, I inform them that the template we agree on is it. If they want to <code>Add</code> a page, that's fine, <code>Move</code> content on a page then great, or <code>Change</code> a page or the content of a page then okay, as long as we still have the same basic template.</p>\n" }, { "answer_id": 10591, "author": "yo'", "author_id": 6133, "author_profile": "https://workplace.stackexchange.com/users/6133", "pm_score": 0, "selected": false, "text": "<p>I think that since you ask on Workspace and no Programmers, you know that you have done what was asked originally, and that you only look for the ways how to explain it to him.</p>\n\n<p>I recommend you to find what exactly you agreed on with him (you might not have the specifics in a contract, but digging up the appropriate mails should suffice). Then tell him that you are willing to do the changes he asks for, but before discussing that, you would like to sort out the agreement you had and you suppose to get the promised money. Present him the contract/mail/agreement if necessary, to make it clear that you have done your job.</p>\n\n<p>If he is irreponsive to that and he doesn't want to pay, then you have to be more straight, friends or not. Just explain him that the job was underpriced at the beginning, that you were happy to help with his project, but that programming costs a lot of time (like other jobs do) and you cannot continue working on that without any extra money, that you want your money now. The politeness is, in my opinion, in making the situation clear. You cannot be very polite to someone who does not understand the situation.</p>\n\n<p>If this is not enough, you have no other option but to remove the project from their site until you two agree on that. This may, however, mean that you are never paid.</p>\n" }, { "answer_id": 10594, "author": "huntmaster", "author_id": 8342, "author_profile": "https://workplace.stackexchange.com/users/8342", "pm_score": 1, "selected": false, "text": "<p>If you're willing and able to do the work, I would quote him your price per hour, and break down the requested additions/changes into estimates. You don't have to charge what you might normally charge, as he is your friend and it's a charity website, but you've completed your original agreement, and this is (at least from what I read in your question) outside the scope of that agreement. </p>\n\n<p>Doing a favor for a friend is all well and good, but you must as some point draw the line and stand up for the value of your time and talent. You don't need to be confrontational about it, but you must make it clear that this is not what you originally committed to.</p>\n" } ]
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. Honest, because if the same problem will exist with your new boss, everyone needs to consider that. But positive because it's never a good idea to have a whinge about your current boss at an interview.</p>\n\n<p>You know that both of these questions are likely to come up, so think very hard about the answer and be very ready.</p>\n\n<p>If you say \"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,\" then you're going to have a hell of a problem when you say that your boss may hold a grudge and may not give you a good reference.</p>\n\n<p>And, make no mistake, you are going to <strong>have</strong> to say that. Most candidates can get good references from previous bosses. If you can't then you need a good reason <strong>and</strong> an alternative.</p>\n\n<p>So make the answer to the first question a mild preparation for the second question. Make it clear that you have no ill-feeling and you think that, in most respects, you think your boss is a decent guy and a decent manager. Then go on to explain that there was a disagreement. Be as specific as you can be, but obviously avoid mentioning if it turned into a physical fight or something.</p>\n\n<p>Then turn it back to a positive note. Make it that you really think it's better for everyone -- you, your boss, your old employer, and your potential new employer -- that you make a new start somewhere else, where your skills are respected and your past and future are positive.</p>\n\n<p>Again, sandwich the negative in two positives and keep the negative as brief as possible, most people won't even notice it. But they will be prepared when you come to talk about references.</p>\n\n<p>Then you can be quick to say \"I really don't know if my boss is holding enough of a grudge to withhold my reference. I will ask him, I don't think it will be a problem, but if he is unwilling, would you accept a reference from ...\" [be very prepared with a name and title]</p>\n\n<p>Also, don't be afraid to approach your current HR about a reference. HR will be very wary of allowing someone to say something bad about an employee while representing the company (particularly if it's a written reference). That kind of thing can land them in court and it's not a risk worth taking, when the perceived \"problem\" is leaving them.</p>\n" }, { "answer_id": 11242, "author": "Val Theo", "author_id": 8799, "author_profile": "https://workplace.stackexchange.com/users/8799", "pm_score": 3, "selected": true, "text": "<p>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:</p>\n\n<blockquote>\n <p>\"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.\"</p>\n</blockquote>\n\n<p>It will also look good if you do some research on that company and their industry prior to your interview.</p>\n\n<p>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.</p>\n" } ]
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://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect\">Dunning-Kruger Effect</a>.</p>\n\n<p>So then, what to do? On one hand, ask yourself how in depth you can go during the interview on the topic. These questions are often a way of <em>negotiating</em> what a valid set of questions would be. Saying \"10\" is going to be code for \"I know everything, and can answer every question you have\". </p>\n\n<p>The only time I ever use this in an interview is when I pair it immediately with something like:</p>\n\n<blockquote>\n <p>How would you get from (Your Answer) to (Your Answer + 1)?</p>\n</blockquote>\n\n<p>In that case, I am using the questions to judge your ability to rate yourself, as well as your understanding about what you do not know and how you would learn it.</p>\n" }, { "answer_id": 11555, "author": "mat690", "author_id": 8833, "author_profile": "https://workplace.stackexchange.com/users/8833", "pm_score": -1, "selected": false, "text": "<p>When asked this question in a face to face interview and it is a technology that I have worked with to deliver any non trivial project then I always say 10 and also give some details of the problem I used the technology to solve.</p>\n\n<p>The reason I do this is because the question is completely meaning less, like the questioner states, its very hard, if not impossible to quantify such a scale and the person asking the question is going to have a different level of expectation than the person answering. Even if that wasn't the case there is no way for any answer to be verified in any meaningful way anyway.</p>\n\n<p>So I believe the only way to take the question is as the interviewer asking you how confident you are in your ability to fulfil their requirements. Almost as if they are seeking your reassurance that you can do the job.</p>\n\n<p>Also usually by the time you at the stage of a face to face interview you have already passed any technical tests they have set you so they already consider you to be at a level at which they are willing to hire you.</p>\n" }, { "answer_id": 11590, "author": "bethlakshmi", "author_id": 67, "author_profile": "https://workplace.stackexchange.com/users/67", "pm_score": 5, "selected": true, "text": "<p>Given how the answer <em>seems</em> straightforward, but is really dependant on your own perspective, I'd say clarify your perspective in the answer... something like:</p>\n\n<blockquote>\n <p>I find that the more you know, the more you know what you need to learn. Generally I'd rate a \"10\" as ((<em>insert how you define ultimate knowledge</em>)), and \"1\" as ((<em>your own words on very basic knowledge</em>)). 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...\"</p>\n</blockquote>\n\n<p>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.</p>\n\n<p><strong>Standards:</strong></p>\n\n<p>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:</p>\n\n<ol>\n<li>I picked up a book and tried a simple project or two. </li>\n<li>I can do basic things, and use a few of the special features.</li>\n<li>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.</li>\n<li>I do better than that.</li>\n<li>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???\". </li>\n<li>Better than that.</li>\n<li>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.</li>\n<li>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.</li>\n<li>Better than that.</li>\n<li>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. </li>\n</ol>\n\n<p><strong>Risks in Rating</strong></p>\n\n<p>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. </p>\n\n<p>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 &amp; 10 range, because if you are wrong and you're really not an expert, you'll come off as dangerously overconfident.</p>\n\n<p>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.</p>\n" } ]
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 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.</p>\n\n<p>Something like:</p>\n\n<hr>\n\n<p>.Net technologies and languages:</p>\n\n<pre>\nC#, VB.Net, WPF, WCF, ASP.Net. (IIS 7.5?)\n</pre>\n\n<p>Web technologies and languages:</p>\n\n<pre>\nJavascript, HTML and CSS.\n</pre>\n\n<p>I'm familiar with databases. </p>\n\n<pre>\nT-SQL. (Maybe MSQL2k8?)\n</pre>\n\n<hr>\n\n<p>If the DB stuff is a bit off you could recatagorize the 'web' to 'other'\nIf 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.</p>\n\n<p>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.</p>\n" }, { "answer_id": 14599, "author": "mhoran_psprep", "author_id": 127, "author_profile": "https://workplace.stackexchange.com/users/127", "pm_score": 2, "selected": false, "text": "<p>It all boils down to compact, neat and updated</p>\n\n<p>If you are constructing the resume for a particular job then make sure the ones mentioned in the job requirements are easily found. If the requirements spell out Visual Basic for Applications then say Visual Basic for Applications (VBA), if they say VBA don't spell it out. Many companies use software to search for the key words. Also consider putting the most relevant at the start/top of the list so a human doesn't miss it.</p>\n\n<p>Also if they specify a particular version, e.g 10.X , don't say 8.0+.</p>\n\n<p>This is an easy part to let get stale, so you should review it every time you update the resume, or at least every year to make sure that nothing is skipped or out of date.</p>\n" }, { "answer_id": 14610, "author": "paj28", "author_id": 10616, "author_profile": "https://workplace.stackexchange.com/users/10616", "pm_score": 3, "selected": false, "text": "<p>I often receive CVs with long lists of skills, and on further questioning find the applicant has only very basic knowledge of a claimed skill. They say \"SQL\"; they mean \"I once saw a database on TV\".</p>\n\n<p>When I see such a list, I normally know at least two or three of the technologies in depth and will ask a couple of pointed technical questions. Are you ready for that level of scrutiny? If you are - fair play; but my experience is that most aren't.</p>\n\n<p>I realise that agents and HR can filter by keywords, so sometimes you have to do this. But for my hiring, you get a lot more credit for only claiming skills you truly have.</p>\n" }, { "answer_id": 137148, "author": "Bernhard Barker", "author_id": 8234, "author_profile": "https://workplace.stackexchange.com/users/8234", "pm_score": 2, "selected": false, "text": "<p>I'd suggest grouping them by your competency at each, with each group being comma-separated.</p>\n<p>This allows you to list technologies you have <em>some</em> experience with, while also highlighting which technologies you're best at.</p>\n<p>Of course these wouldn't give <em>that</em> much information in absolute terms (one person may call themselves an &quot;expert&quot; while someone else might call that level of knowledge &quot;basic exposure&quot;), but it does give some information in <em>relative</em> terms - you should at least be better at the language you listed under a higher competency than one you listed under a lower competency.</p>\n<p>For example:</p>\n<blockquote>\n<p>Proficient in C#, Javascript, T-SQL</p>\n<p>Comfortable with WPF, WCF, VB.Net</p>\n<p>Real-world experience in ASP.Net, HTML, CSS</p>\n</blockquote>\n<p>You can change the names of these groups to your preference. Although I would recommend sticking to 3 groups (or even just 2). Any additional group would likely just be noise - a general idea of how well you know which technology is good, trying to convey this exactly is much more prone to error and disagreement.</p>\n<hr />\n<p>I might not recommend this approach if you're mixing different categories of technologies - programming languages, databases, operating systems, etc. Those might be best grouped by category instead.</p>\n" }, { "answer_id": 137173, "author": "dwjohnston", "author_id": 32078, "author_profile": "https://workplace.stackexchange.com/users/32078", "pm_score": 0, "selected": false, "text": "<p>I want to add that you need to remember that your CV has two audiences: </p>\n\n<ul>\n<li>Recruiters/HR who don't know how the technology is being used, and are possibly just looking for some key buzzwords. </li>\n<li>Technical leads who do know how the technology is used, and aren't going to be impressed with just a list of buzzwords, or self-assessed x/10 ratings for technologies. </li>\n</ul>\n\n<p>The challenge is - you need to appeal to both people. </p>\n\n<p>The way I solve it, is at the start of my CV I have a section that looks like this: </p>\n\n<pre><code>SKILL SET\n\nCore Skills Some Exposure\n\nJavaScript SQL \nNode ...\nReact\n... \n\n</code></pre>\n\n<p>This is to appeal to the recruiter who just needs to tick some boxes. </p>\n\n<p>Later in my experience section, I write it like this: </p>\n\n<pre><code>Acme Ltd 2005-2007\nSoftware Engineer\n\nI was responsible for creating a frontend with React/Redux,\nworking from designs from a designer,\nand a REST API spec from the backend team.\nI also created frontend tests using Jest and Enzyme. \n\nTechnologies used: Javascript, TypeScript, React, Redux,\nImmutableJS, Jest, Enzyme, Git, Jira. \n</code></pre>\n\n<p>The technologies used list is to provide more credibility to the recruiter for the technologies you have used (ie. how recent it is), while the description of the task is to provide credibility to the technical lead (ie. that you're not just listing some technologies), and give them some context for them to ask further questions. </p>\n\n<p>You'll note that I include 'git' and 'jira' in the technology list. This is more for the recruiters sake - as this may be one of the things they are looking for, whereas a technical lead really doesn't need a sentence explaining how you used git and jira, unless you were doing something particularly special with it. </p>\n" } ]
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 -- 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.</p>\n\n<p>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.)</p>\n\n<p>It looks something like this:</p>\n\n<pre><code> MY NAME\n =======\n\n My City, ST, 12345\n My.Email@example.com\n .\n .\n .\n</code></pre>\n" }, { "answer_id": 11949, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>I think it is important is if you are relocating or you telecommute, so your current employment history is not in the area where you're applying. You don't want there to be any confusion. An employer may think you'll request moving expense reimbursement or you're goling to want to work remotely.</p>\n\n<p>Living in a large city can bring up commuting concerns. Several companies have mentioned this during interviews. Some have had issues with employees who are willing to take a job with a long commute until something comes up closer to home.</p>\n\n<p>These aren't a big deal, but why force an employer to ask uneccesary clarification questions during the interview.</p>\n" }, { "answer_id": 11953, "author": "nadyne", "author_id": 7293, "author_profile": "https://workplace.stackexchange.com/users/7293", "pm_score": 3, "selected": false, "text": "<p>I think that the answer to this question is dependent on the industry and your location. For positions where the demand for employees is high and applicants are highly-skilled and highly-educated, location is less of a concern for the employer. For positions that don't have such high requirements for education and skill, location is more likely to be a consideration in hiring because employers have no need to consider potential employees outside of the current area. </p>\n\n<p>\"Commuting distance\" is a tricky thing for recruiters to evaluate. Different people have different definitions of this. One of my colleagues has a 2-hour commute each way, and he makes that commute every day, which I find unfathomable. </p>\n\n<p>Personally, as a software engineer, I haven't listed my home address on my resume in several years. My resume and LinkedIn profile list my employer's location, which I view as sufficient information. Most recruiters who have pinged me and are outside of my local area have noted this in their email to me, and have asked in their introductory email whether I'm open to positions that would require relocation.</p>\n" }, { "answer_id": 11974, "author": "happybuddha", "author_id": 7978, "author_profile": "https://workplace.stackexchange.com/users/7978", "pm_score": 1, "selected": false, "text": "<p>It is indeed alright to leave out snail main address(es) from resumes. In most scenarios the recruiters will ask for a <em>current</em> address from the qualifying candidate, which is then used to either mail in an offer letter or just update HR records. A lot of candidates give just a PO Box no. which is perfectly fine. <br/>One has to remember that resumes these days are no longer local. A lot of international candidates will mention at least one 'permanent address' on their resumes. If an employer is participating in E-Verify, or requires clearance for candidates on work permits, they may be required to gather a candidates mailing address and cross check with the latest <a href=\"http://www.uscis.gov/portal/site/uscis/menuitem.5af9bb95919f35e66f614176543f6d1a/?vgnextoid=c1a94154d7b3d010VgnVCM10000048f3d6a1RCRD&amp;vgnextchannel=db029c7755cb9010VgnVCM10000045f3d6a1RCRD\" rel=\"nofollow\">AR-11</a> form the candidate filed. This is of course a situational/circumstantial thing.<br/>\n<br/>Although one is not required by (US) law to live at an address (so no employer can deny employ-ability for the lack of an address) it could raise an eyebrow. Nevertheless, a commonly followed trend is to at least provide a PO Box no. </p>\n" } ]
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 make a sale to them. </p>\n\n<p>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:</p>\n\n<pre><code>Written book on 'Genetic Engineering' called \"How to breed wrestling plants\", published 2004 - ISBN 1337\n</code></pre>\n\n<p>This then shows what its about, what its called and when it was written.</p>\n\n<p>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.</p>\n\n<p>--</p>\n\n<p>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. </p>\n\n<p>This would also aid you in drawing more attention to this experience than putting it in other. </p>\n" }, { "answer_id": 12295, "author": "TooTone", "author_id": 9432, "author_profile": "https://workplace.stackexchange.com/users/9432", "pm_score": 2, "selected": false, "text": "<p>A CV is about selling yourself, so you need to weigh the importance of the books to the roles you are applying for, against other experience or qualifications that you have. If the books are important they should be nearer the top of your CV and if they're particularly relevant, mentioned in your covering letter. You could, for example, list the books as part of your work experience near the front of your CV, if they're important, or, otherwise in a separate publications section at the end. If you took time out of work to write them, then there is a stronger argument for listing them in your experience section, so what you did in the \"gap\" is obvious.</p>\n\n<p>Finally, if the books have got good recommendations on amazon, say so! Likewise, it would be certainly be worth quoting positive, official reviews.</p>\n\n<blockquote>\n <p>\"Cottage Gardening\", published 20xx, rated 4.5 on amazon.com out of 234 reviews. Reviewed in Gardeners' World, xx July 20xx: \"Root and branch coverage of your cottage garden\".</p>\n</blockquote>\n" } ]
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 customer is billed at 2x the rate the employee is paid.</p>\n\n<p>The extra amount covers: the employee benefits including medical, dental, vision, life; matching social security and Medicare, and unemployment insurance. It is also used to fund the holiday, vacation, and sick leave hours.</p>\n\n<p>They also have to pay overhead for the office space, office staff, office expenses.</p>\n\n<p>Then they want to make a profit. Frequently that is around 8% of the fully burdened rate. </p>\n\n<p>If you have a company supplying befits and providing services for you it seems like they take half the money, but it is more complex than that.</p>\n\n<p>Example:\nEvery 2 weeks your gross pay check is 4,000. You think you make $50 per hour or 104,000 per year for 2080 hours of work.</p>\n\n<p>Your company is billing the government $100 per hour for the 1,840 hours of work you can be billed for during the year for a total of 184,000: 104K in pay, 65K in benefits and overhead, and 15K in profit.</p>\n\n<p>The question is can you replace the benefits for that price and realize that they don't bill when you don't work. So they have to charge more to cover those costs. Taking the payments directly makes the most sense when your benefits are covered from another source: retired from the military, or coverage from your spouse.</p>\n\n<p><strong>Edit:</strong> The term \"W2 contractor\" in the original question doesn't make any sense. If you get a w2 you are an employee. The level of benefits are based on the company rules and labor laws. If you are contractor you get zero benefits, you are self employed and responsible for specific taxes. If Joe's contracting company is paying you 70K plus benefits, but you now want to work directly for the customer they will pay you 70K plus benefits as an employee (assuming the benefits are equal), or they need to pay you $70 an hour as an independent contractor. Of course the actual rates will need to be negotiated and depend on what benefits you are looking for.</p>\n" }, { "answer_id": 12392, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>It all boils down to what you are worth relative to where your skills fit in the market.</p>\n\n<p>I don't think this should be just a matter of: What were you paying before that the company is paying now? They will factor all that in but you don't have to. This is a negotiation.</p>\n\n<p><strong>Benefits of Being an Employee</strong></p>\n\n<p>Check your taxes and consider what they're going to pay compared to what you paid.</p>\n\n<p>Healthcare could be a little tricky. Let's say you pay 100 per month (pick your currency this is hypothetical). The company offers a similar plan (good luck comparing the two) and you will only pay 25. What does the difference of 75/month mean? </p>\n\n<p>This is going to give you an idea of what you may be willing to settle for along with some knowledge of what their offer is going to be based on. Do the math.</p>\n\n<p><strong>What you're really worth.</strong></p>\n\n<p>Was your contracting rate at the level of your expertise? Some people start out in contracting and may have been payed a lower fee because they were not experienced with a proven track record.</p>\n\n<p>Has the market changed since you were hired or do you now have some better insight into what the market is like?</p>\n\n<p>You should be able to leverage the fact that you are a proven employee and that is worth something or they shouldn't be hiring you. </p>\n\n<p>Depending on how far off you were on your contract salary, you may try and negotiate for no paycut at all. You should still be testing the job market to see what you can get. <strong>Don't get locked into purely basing it on the contract salary minus full-time benefits.</strong></p>\n\n<p><strong>Edit a little clarification:</strong></p>\n\n<p>If you are the full-time employee of the agency (W-2?), they are paying your salary and possibliy benefits. There is a markup because they had to seek the candidates, do some screening and then replace them if they don't work out. I don't think any of this has to do with your salary. You need to clarify what is your salary and does that include benefits (and the value of those benefits). Are you working on contract independanty or as \"someone's\" full-time employee with benefits?</p>\n" }, { "answer_id": 12394, "author": "Amy Blankenship", "author_id": 1437, "author_profile": "https://workplace.stackexchange.com/users/1437", "pm_score": 4, "selected": true, "text": "<p>I wouldn't accept <em>any</em> 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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>By contrast, I was working 1099 for the company I work for now (W-2), and I <em>did</em> take a 30% pay cut to go w-2.</p>\n" } ]
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 (header etc) just seems very a-typical for email. In addition, you say that this mail is not necessarily something formal, so I would not feel inclined to be overly formal. </p>\n" }, { "answer_id": 12665, "author": "mhoran_psprep", "author_id": 127, "author_profile": "https://workplace.stackexchange.com/users/127", "pm_score": 5, "selected": true, "text": "<p>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.</p>\n\n<p>I would just stick to the following format:</p>\n\n<blockquote>\n <p>Dear Ms. Waters:</p>\n \n <p>I was very happy to receive your email regarding the position of head 6th grade teacher at the Children's Day School. </p>\n \n <p>I look forward to hearing from you regarding any paperwork and required steps that need to be done prior to joining the company.</p>\n \n <p>Thank you again, Ms. Waters, for providing me with a wonderful opportunity. </p>\n \n <p>Sincerely,</p>\n</blockquote>\n" } ]
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> academic for an office environ(but maybe i'm wrong). </p>\n\n<p>But yes to:</p>\n\n<pre><code>Working on my own personal engineering projects that would increase my professional knowledge\n</code></pre>\n\n<p>and</p>\n\n<pre><code>Surf the web spending as much time as possible on professional matters\n</code></pre>\n\n<p>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. </p>\n\n<p>Nice problem to have, i'd say!</p>\n" }, { "answer_id": 12689, "author": "Meredith Poor", "author_id": 9517, "author_profile": "https://workplace.stackexchange.com/users/9517", "pm_score": 0, "selected": false, "text": "<p>If the remote systems are for a client, and the client is, for example, a bank, then a good thing to do is learn more about banking. In short, it isn't necessarily your technology development that makes the most sense, but the business matters the project you're working on solves. You're 'surfing' might be in the direction of the regulatory framework your client works in, or issues with logistics if it's a company selling products, or cost issues with running an airline if it's an airline. In short, try to get more inside your customer's shoes.</p>\n" } ]
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> academic for an office environ(but maybe i'm wrong). </p>\n\n<p>But yes to:</p>\n\n<pre><code>Working on my own personal engineering projects that would increase my professional knowledge\n</code></pre>\n\n<p>and</p>\n\n<pre><code>Surf the web spending as much time as possible on professional matters\n</code></pre>\n\n<p>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. </p>\n\n<p>Nice problem to have, i'd say!</p>\n" }, { "answer_id": 12689, "author": "Meredith Poor", "author_id": 9517, "author_profile": "https://workplace.stackexchange.com/users/9517", "pm_score": 0, "selected": false, "text": "<p>If the remote systems are for a client, and the client is, for example, a bank, then a good thing to do is learn more about banking. In short, it isn't necessarily your technology development that makes the most sense, but the business matters the project you're working on solves. You're 'surfing' might be in the direction of the regulatory framework your client works in, or issues with logistics if it's a company selling products, or cost issues with running an airline if it's an airline. In short, try to get more inside your customer's shoes.</p>\n" } ]
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 internal transfer as different companies may have various rules about things.</p>\n\n<p>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.</p>\n\n<hr>\n\n<p>There is something to be said for having a prepared answer in a few scenarios here:</p>\n\n<ol>\n<li><p>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?</p></li>\n<li><p>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.</p></li>\n</ol>\n" }, { "answer_id": 13114, "author": "ojblass", "author_id": 9829, "author_profile": "https://workplace.stackexchange.com/users/9829", "pm_score": 2, "selected": false, "text": "<p>This is what is known as a lateral transfer. I would suggest speaking with Manager 1 before speaking to Manager 2. Discuss with your manager that you want to apply for a job with Team 2. Tell him that you are perfectly willing to transition your job responsibilities and work with him if he can help make this happen. Discuss your reasons with him. Do not treat him like an enemy. He may also be able to provide you guidance on how to meet your career aspirations and maximize your potential. In this way you are showing your manager respect and proving your loyalty to ensuring that any transfer would be smooth. He may appreciate that. </p>\n" }, { "answer_id": 13187, "author": "nadyne", "author_id": 7293, "author_profile": "https://workplace.stackexchange.com/users/7293", "pm_score": 0, "selected": false, "text": "<p>You can email Manager2 and ask for an informal \"informational interview\" so that you can learn more about the position. This is usually on the order of a half-hour or hour, and gives Manager2 an idea of whether you're a good fit for the open position, and gives you the chance to see whether Team2 is actually one that you do want to join.</p>\n\n<p>If the informational interview goes well and you and Manager2 both want to move forward with an interview, then take a look over your company's HR guidelines about transferring to another department. Your company might have a simple set of guidelines, or might spell out the complete process. Knowing what HR expects out of such a move makes your life easier. As part of this, learn what your manager can and cannot do if you want to move. For example, in large companies, your current manager might have the power to say that you can't move out of your current position for X weeks/months because you have a major deadline coming up, but can't block a move indefinitely. </p>\n\n<p>Next, have the conversation with your current manager about wanting to grow in other ways, that you have identified that there is an opening on another team that you want to pursue, and that you'd like your current manager's guidance in the right way to move forward. This is where your knowledge of what the official policies are can be very helpful. If you're lucky, that research will prove to be unnecessary, because your manager will recognize that it's better for you to be a happy employee on another team at your company than an unhappy employee on your existing team. If you're unhappy in your current role, it's much better for the company as a whole to let you move to another role within the company where you will be happier, as opposed to losing you to another role at another company. In the best case, your manager will explain to you what the process is for interviewing for another position within your company and will discuss timelines with you. In the worst case, you'll have to fall back on what you learned about your company's rules about such moves. If it is the worst case, then you've also learned a lot about your manager, which you'll have to consider for what it means in your career going forward. </p>\n" }, { "answer_id": 14589, "author": "mosoda", "author_id": 9094, "author_profile": "https://workplace.stackexchange.com/users/9094", "pm_score": 0, "selected": false, "text": "<h3>OP Answer</h3>\n\n<p>I asked HR about the process and they said it is required to ask my current manager first.\nThen I asked my manager and he was happy to help me to move to a team that I have more interest in their work. I went through a normal interview process and got accepted by my destination team. Now I should work with my team to help new members get up to speed and then move to my new team.</p>\n" } ]
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 that changing the code was necessary.\nSince your boss doesn't have a programming background, maybe you should try to explain the problem to him with an analogy. Explain the problem as an everyday problem, for example: if we were building a car, said vehicle wouldn't work because of this and that problems of design, therefore we should redesign.\nMaybe with a different approach your boss will understand more clearly why you should rewrite the code. I must stress that you shouldn't necessarily \"blame\" the author of the code for the evident deficiencies (even if he wrote it poorly in the first place), because it could give the wrong impression to your boss and cause you unnecessary problems. Instead, suggest ways to improve the code and explain why you believe that those are the way to go.</p>\n" }, { "answer_id": 13532, "author": "Meredith Poor", "author_id": 9517, "author_profile": "https://workplace.stackexchange.com/users/9517", "pm_score": 3, "selected": false, "text": "<p>First, 'needs a rewrite' is vague. You have to be able to draw boxes around offending code or definitions.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>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.'</p>\n\n<p>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.</p>\n\n<p>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.</p>\n" }, { "answer_id": 13535, "author": "the_reluctant_tester", "author_id": 2026, "author_profile": "https://workplace.stackexchange.com/users/2026", "pm_score": 3, "selected": false, "text": "<p>You need to convince him in the language that he understands. </p>\n\n<p>Are you able to quantify the impact of \"bad\" code?</p>\n\n<p>How much technical debt have you incurred, how it is impacting developer productivity, code stability, quality.</p>\n\n<p>Are you able to give him a demo on the lines of</p>\n\n<ol>\n<li>Take the worst area of the code could be the buggiest,unstable or in extensible due to bad code.</li>\n<li>Choose a current metric - X number of hours to review code, Y number of bug currently in the code due to it being of poor standards, Z number of hours to extend current code to implement feature A</li>\n<li>Refactor or redesign it </li>\n<li>Reflect change and demonstrate how much time it takes now .....X1 , Y1, Z1 </li>\n</ol>\n\n<p>This won't be trivial effort and could be a mini project. But if you feel strongly about the situation and want to change it, dont ask permission and do it and show him the results.</p>\n" }, { "answer_id": 13549, "author": "Neil T.", "author_id": 5016, "author_profile": "https://workplace.stackexchange.com/users/5016", "pm_score": 2, "selected": false, "text": "<p>I have been in your situation many times before, and have had similar issues involving the inheritance of bad architecture and poorly maintained code in the past and present. Fortunately, in my current position, my boss <strong>does</strong> have a programming background and has encouraged me to do whatever I need to do to improve the quality from both a performance and change management perspective.</p>\n\n<p>Because your boss lacks the technical expertise to fully comprehend what you mean, you are never going to get his/her buy-in on making wholesale changes to the code. The best you can hope to do is restructure an rebuild it piece by piece as you go along. Draft a master infrastructure plan and instruct the other developers that any future additions or revisions need to be implemented according to that plan. This way, everyone gets what they want--your boss gets to keep the water running and you get to install brand new pipes where they are most needed, instead of having to patch on top of patches. In addition, it will give you a little extra time to dig deeper into the existing requirements of the system and incorporate any \"new\" requests that have been sitting on the back burner because of the instability of the current system.</p>\n" } ]
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>&gt; Very similar list in my Daily report that I have worked all long a &gt; 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 someone will take on a project and become so engrossed in completing the project that updates or set procedures may be forgotten about momentarily. This is not a good idea, especially if it is a long term project. Regular updates make people feel more involved in the project and it also serves to put their mind at ease that you are doing your best work possible.</p>\n\n<p>By using a standard template this is a more effective communication tool than a simple email because you can arrange information in a more visually engaging way. This ensures that those you are communicating with are sure to take note of the most important information. Often times in a simple email, individuals will skim the contents in order to save time. When people do this they often miss important details. When all of the information can be conveyed precisely the first time, everyone saves time and gets more accomplished.</p>\n\n<p>Have a look at <a href=\"http://www.google.co.uk/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;frm=1&amp;source=web&amp;cd=5&amp;sqi=2&amp;ved=0CGcQFjAE&amp;url=http://mifos.org/sites/rollout.mifos.org/files/Weekly%2520Status%2520Report%2520-%2520Template.doc&amp;ei=0qQEUqqGL5Lo7Abf8oGoBw&amp;usg=AFQjCNERIi8tXqx5dFJlreBO3PUdYOwUTA&amp;sig2=ydUhsTisRA8R0hMDQCOYMQ\" rel=\"nofollow\">this link</a> where you can download a template to use for yourself and below that you will find a status update provided as a sample of the end result.</p>\n" }, { "answer_id": 13748, "author": "Joe Strazzere", "author_id": 7777, "author_profile": "https://workplace.stackexchange.com/users/7777", "pm_score": 2, "selected": false, "text": "<p>With all communications, there are two important parts - the sender, and the receiver.</p>\n\n<p>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.</p>\n\n<p>In this case, you should talk to the recipient(s) of your Status Report and ask:</p>\n\n<ul>\n<li>What information do you need from me in my Status Report? and</li>\n<li>Is what I am sending understandable?</li>\n</ul>\n\n<p>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.</p>\n\n<p>Good luck!</p>\n" } ]
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 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. <code>Hard worker</code> becomes <code>tireless, driven &lt;programmer, account manager, marketing associate&gt;</code>. <code>Team player</code> becomes <code>dedicated to the success of my teammates</code>, etc. </p>\n\n<p>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. </p>\n\n<p>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.</p>\n" }, { "answer_id": 14899, "author": "Meredith Poor", "author_id": 9517, "author_profile": "https://workplace.stackexchange.com/users/9517", "pm_score": 1, "selected": false, "text": "<p>If you're a 'team player', then it's possible to describe what team you were on, what position you were 'playing', and how you helped win the 'game'. Replace 'team player' with 'front end developer on team migrating ecommerce app from PHP to JQuery - worked with database designer (model) and business process developer (controller) groups to develop clean, attractive, and efficient user interface'.</p>\n\n<p>This replaces the vague with the specific. Even if the only 'team playing' you've done is in university assignments, document the structure and objectives of the teams and what you did to contribute.</p>\n" } ]
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 in my CV I used a industry relevant term. </p>\n\n<p>As long as you job title reflects the role accurately there should not be a problem. </p>\n" }, { "answer_id": 15265, "author": "thursdaysgeek", "author_id": 249, "author_profile": "https://workplace.stackexchange.com/users/249", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n\n<pre><code>Acme, Inc (Software Engineer - QC) - June 2009 to present\nOn a team of 8, developed software in C# with a SQL Server backend, also using\nJava, SSIS, and a bit of C++. Worked with users developing new software.\nImplemented a process that reduced bug reports by 10%, and led the process\nchanging from standard waterfall to agile.\n</code></pre>\n" } ]
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 brand. </li>\n<li>At that interview, your apparel, personal grooming, body language, swagger (or lack thereof), mannerisms, and vocabulary will all be evaluated.\n<ul>\n<li>They will \"say\" much more than your resume ever could.</li>\n</ul></li>\n<li>Therefore, you should always be inclined to \"overdress\" for an interview rather than \"underdress\".</li>\n<li>If you earn a position at the hiring company, there will be plenty of time later to wear shorts and flip-flops.</li>\n</ul>\n" }, { "answer_id": 15313, "author": "Jeanne Boyarsky", "author_id": 1512, "author_profile": "https://workplace.stackexchange.com/users/1512", "pm_score": 2, "selected": false, "text": "<p>No. At an interview you are generally expected to dress better than the people do who are working there every day. You don't have to wear a suit since they are so casual. But you shouldn't wear flip flops or shorts.</p>\n" }, { "answer_id": 15315, "author": "Meredith Poor", "author_id": 9517, "author_profile": "https://workplace.stackexchange.com/users/9517", "pm_score": 2, "selected": false, "text": "<p>If you hang around with the employees of that company and you're all dressed like tramps then it could hardly matter what you do at an interview - your 'real' interview occurred in the beer joint (-hall, -garten, or whatever they call it in Berlin). However, I wouldn't wear a suit or even a tie, either.</p>\n\n<p>If you have any way of meeting some of the people before you do the interview do this first. If not, dress in reasonable street clothes. Your interviewer is probably not going to be running around with a shirt tail hanging out, but it is likely you'll be given a tour and you'll see the 'real people'. Most likely you'll find a few that are 'out there', but most will look at home in a college classroom.</p>\n\n<p>Dress the way you're most comfortable. Very often programming groups dress in scraggly clothes to drive off certain people they don't want around - usually 'corporate types'. Focus on the technical side and ignore the clothes - this may be the message they want everyone to get.</p>\n\n<p>\"Clerk needed for mail order stockroom in nudist camp. All interviews are in person.\"</p>\n" }, { "answer_id": 15317, "author": "ApplePie", "author_id": 4971, "author_profile": "https://workplace.stackexchange.com/users/4971", "pm_score": 4, "selected": true, "text": "<p>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.</p>\n\n<p>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.</p>\n" }, { "answer_id": 15320, "author": "jmoreno", "author_id": 271, "author_profile": "https://workplace.stackexchange.com/users/271", "pm_score": 1, "selected": false, "text": "<p>That depends upon what you want to get out of the interview. There are many reason why you might go to an interview and you can get multiple things out of an interview.</p>\n\n<p>That said, if you are not offered the position, you may not be able to determine whether your dress was a factor in their decision. So, if that is what you seek to learn, it may not be possible.</p>\n\n<p>If what you are interested in is working at a place where showing up in flip flops is acceptable, I would suggest dressing as you would like to work - if that is in flipflops then, yes, if it's in tennis shoes and a T-shirt, then that.</p>\n\n<p>The real challenge is what to do if you like wearing three piece power suits, and to that I'd say -- wear the suit, but be start off the interview by saying you hope they don't hold it against, but you really like suits and hope they can accept that.</p>\n" }, { "answer_id": 15322, "author": "Community", "author_id": -1, "author_profile": "https://workplace.stackexchange.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>I would dress casually to the level I felt comfortable. Being too dressed-up may be a sign you wouldn't fit in the company culture. </p>\n\n<p>Hopefully, they posted this in the spirit of being transparent about the company and not as playing some type of game to see who falls for this trap and chooses not to dress professionally. If they're going something evil, they'll be doing you a favor by not hiring you. If possible, post this nonsense and let everyone know to watch out.</p>\n" } ]
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 that the motivation to work though the set targets is there. Do they know that you want to reorganize? do they support your plans? <a href=\"http://wikireedia.net/wikireedia/index.php?title=Kotters_8_steps_for_implementing_strategy\" rel=\"nofollow\">Kotter's 8-step plan</a> might be useful here.</p>\n\n<p>Once you've established that there is a need for training, you'll need a plan. This plan has to contain the goals for the trainee that have been well formulated (e.g. <a href=\"https://en.wikipedia.org/wiki/SMART_criteria\" rel=\"nofollow\">SMART</a>)\nI would certainly list the following things in such a plan:\n<li> Goals of training\n<li> Time frame in which the training has to be completed\n<li> Ways of measuring goal attainment.</p>\n\n<p>Training can be organized in a couple of ways.\nOf course there are formal classes and courses you can sign up for, but that usually costs quite a bit of time and money.\nFor technical training a mix of reading books and practising is often a good way to further proficiency. sending the employee though a certification process is a nice added bonus that confirms proficiency and adds value for the trainee as well.\nIf the training you want to organise is more of the organisational process type. I'd probably explain them in a lecture type of setting with some on he job support for getting proficient at the new way of working.</p>\n\n<p>That being said, I can hardly imagine that there's going to be such a fixed division of labour at such a small firm. I feel that, although specialisation is a good thing and the resulting division of labour will likely improve efficiency, a team this small will probably be likely to self organize more than it is going to be directed top-down. (unless you're in the army or something)</p>\n" }, { "answer_id": 15563, "author": "bethlakshmi", "author_id": 67, "author_profile": "https://workplace.stackexchange.com/users/67", "pm_score": 3, "selected": true, "text": "<p>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.</p>\n\n<p><strong>Staff Assignments</strong></p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p><strong>Knowledge Transfer</strong></p>\n\n<p>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:</p>\n\n<ul>\n<li><p><strong>Industry Knowledge</strong> - 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.</p></li>\n<li><p><strong>Coordinated Process</strong> - 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.</p></li>\n<li><p><strong>Common How Tos</strong> - 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.</p></li>\n</ul>\n\n<p>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.</p>\n\n<p><strong>Onboarding</strong></p>\n\n<p>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.</p>\n\n<p>That's the real curve and I'd say there's probably no way to handle it perfectly.</p>\n\n<p>Tips I've seen that help are:</p>\n\n<ul>\n<li>Get the managers aware that regular checkins with the new person are very important</li>\n<li>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.</li>\n<li>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.</li>\n<li>Update documentation and resources right after the new person starts succeeding, so that you have recent information on what works.</li>\n</ul>\n\n<p><strong>Adult Learning</strong></p>\n\n<p>When it comes to formal training programs, use the information above as a guide for <em>where</em> to train folks. That said, there's some general tips from an adult learning perspective:</p>\n\n<ul>\n<li><p>Different generations and different cultures have different learning styles. The Internet generation, for example, is extremely comfortable with Internet resources, including YouTube, Q&amp;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).</p></li>\n<li><p>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&amp;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.</p></li>\n<li><p>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.</p></li>\n<li><p>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.</p></li>\n</ul>\n\n<p>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.</p>\n" } ]
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.