How to take existing post and create a template from it

I have a set of posts that have a basic layout, and I want to set these post settings in the default template. I am not using anything special or custom in the post layout settings: everything is built=in to wordpress. There does not seem to be an easy way to just change the basic settings for the default template in wordpress.

My question is:
How do I change the default post template to match the layout of my current posts?


Currently, I have to manually force the sidebar to appear, hide featured image, and hide author name when a post is created. I want the default template to apply these options by default, but I cannot figure out how to edit the default template. I do not know if this is a theme problem (I am using The7).

samsung – How to check existing Android Exchange Domain settings

I am installing my wife’s new phone using Samsung Smart Switch.

It nicely installs all apps, including Outlook, however it does not copy the account settings for her Exchange mail.

I know her Outlook mail address, mail server name and password, but have not been able to find her domain setting in any documentation or in the settings of her old phone (domainusername).

Is there any we of discovering that domain setting on her OLD mobile ?? I have tried to find it, without any luck. And service desk of her work is unavailable during the weekend. Hence my question.

Many thanks,

security – What prevents somebody from “re-mining” an already existing Bitcoin?

This may reveal that I know nothing about math or cryptography.

Let’s say that a given Bitcoin was “lost” in that it was once mined and assigned/given to a person who had it in their wallet.dat, but then they either lost the password to this file, or deleted it, or otherwise lost access to it forever (or without any realistic hope of ever retrieving it).

Now, that Bitcoin has been mined out of the 21,000,000 total ones ever, but it’s “lost”.

But if a computer once guessed the right private key for that coin, why can’t another computer do it again?

Basically, isn’t it possible that all the Bitcoins that are currently mined and in possession of somebody, could be “re-mined”?

Is it just “extremely unlikely”? And you cannot “target” a specific existing private key/receive address/Bitcoin?

I’m always fearing that one day, somebody “re-mines” the Bitcoins that I have, thus seizing access to them, either by sheer accident or by somehow deducing the ones I own and specifically try to “re-mine” those in order to make me poor?

ssd – Is it possible to manually TRIM the free space for an existing APFS volume?

When migrating a MacBook from HDD to SSD, I did a block-level copy using dd. Because the SSD already contained a different OS image from a previous test, I believe for optimal performance, it would be the best to issue a TRIM for every unused block in the new filesystem to inform the SSD controller. Is it possible to TRIM the free space manually for an AFPS volume on macOS (like FreeBSD’s trim or Linux’s fstrim)?

I’ve read that macOS’s fsck has a TRIM pass, so TRIM can be triggered manually by running fsck -fy in single-user mode. But I didn’t see any message about TRIM when I tried it, so I guess it’s only applicable to HFS+ filesystems.

cropping – Crop overlap in existing panorama

I have multiple partial spherical panorama pictures taken using the standard Android panorama function. The problem is that the panorama does not stop at 360 degrees, but is overlapping at the left/right border.
So it contains not just only 360 degrees, but more – let’s say 365 degrees.

I tried to autocorrect the images and crop right or left with hugin, but without success. I can import the image using the equirectangular type and 360 degrees horizontal field of view, but I was not able to automatically (or manually) find control points in the same image in order to recognize and correct the overlap. The only way was to manually limit the horizontal angle of view using the slider on the bottom.

Is there a way to (ideally automatically without GUI) recognize and crop the overlap?

7 – How to validate a value against an existing field

install entity_validator module .

Unlike Drupal 8, Drupal 7 has not validation for entity objects what
so ever. One of your modules can create a node object without any
title or a language and you don’t want that.

for drupal 8 Use Entity Validation before save your fields.

as a example

 $violations = $typed_data->validate();
    $definition = DataDefinition::create('integer')
      ->addConstraint('Range', ('min' => 5));
    $typed_data = Drupal::typedDataManager()->create($definition, 10);
  if ($violations->count() == 0) { // this means there is not any validation error
     // save Entity

sharepoint server – Get ItemCount from Existing View

I have a Task list that I’m trying to query to get the total Active Tasks for the current user. There is a view already built that I would like to use.

/_api/web/lists/getbytitle('Tasks')/views/getbytitle('My Tasks')/ItemCount

However, it throws an error:

Cannot find resource for the request ItemCount

Is there a way I can grab the item count from an existing view using the REST API ?

google pixel – How to create a script that inputs parameters into an already existing app

I’m not even sure if script is the right term, I’m pretty new to coding with mobile devices, but it’s what I thought of.

I’m trying to create some kind of program to modify the parameters of apps that require them, specifically doing so automatically on a timer. For example automatically putting in GPS coordinates at intervals to make it appear that the device is moving. I’m not really sure how to start learning stuff like this, as I don’t have a lot of experience with android. Any suggestions are appreciated!

If it matters I have some experience with Java and with Python, and a little bit with Linux shells.

8 – How to extend existing ‘access comments’ permission?

I am trying to extend access to comments based on the entity they are attached to.

I have created permissions in my permissions.yml file as following.

view user comments:
  title: 'View comments attached to Users'

Then in my .module file, in a hook_entity_type_build() I have changed the Handler Class for the Comment entity with my custom one.

 * Implements hook_entity_type_build().
function MY_CUSTOM_MODULE_entity_type_build(array &$entity_types) {
  // I need this so I can alter the Comment Permisions with my custom ones.
  if (isset($entity_types('comment'))) {
    $entity_types('comment')->setHandlerClass('access', 'DrupalMY_CUSTOM_MODULEAccessCustomCommentAccessControlHandler');

My custom class extends the initial Handler and I am only overwriting what I need.

 * Adds a custom access handler for Comments.
class CustomCommentAccessControlHandler extends CommentAccessControlHandler {

   * {@inheritdoc}
  protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {

DELETE, UPDATE and CREATE/REPLY work exactly how I wish and how I’ve overwritten them but my issue is with VIEW.

I have defined my view case in a switch in the checkAccess function like this (please note that the other cases in my switch behave as desired):

case 'view':
  // View comments depending on the parent entity.
  $canViewUserCom = $account->hasPermission('view user comments');
  // If parent entity is user.
  if ($entityType == 'user') {
    $access = AccessResult::allowedIf($canViewUserCom)
    // Set reason when forbidden or neutral.
    if (!$access->isAllowed()) {
      $access->setReason("The 'view user comments' permission is required.");

I have debugged the $access variable and it returns what it needs to. I have tried to forbid access completely just to debug and it does not seem to overwrite the ‘access comments’ permission not matter what I do.

I have debugged further and I got to this class in the comment module.

namespace Drupalcomment;

use DrupalCoreAccessAccessResult;
use DrupalCoreFieldFieldItemList;
use DrupalCoreSessionAccountInterface;

 * Defines a item list class for comment fields.
class CommentFieldItemList extends FieldItemList {

Inside this class, there is a function called access() which looks like this:

   * {@inheritdoc}
  public function access($operation = 'view', AccountInterface $account = NULL, $return_as_object = FALSE) {
    if ($operation === 'edit') {
      // Only users with administer comments permission can edit the comment
      // status field.
      $result = AccessResult::allowedIfHasPermission($account ?: Drupal::currentUser(), 'administer comments');
      return $return_as_object ? $result : $result->isAllowed();
    if ($operation === 'view') {
      // Only users with "post comments" or "access comments" permission can
      // view the field value. The formatter,
      // DrupalcommentPluginFieldFieldFormatterCommentDefaultFormatter,
      // takes care of showing the thread and form based on individual
      // permissions, so if a user only has ‘post comments’ access, only the
      // form will be shown and not the comments.
      $result = AccessResult::allowedIfHasPermission($account ?: Drupal::currentUser(), 'access comments')
        ->orIf(AccessResult::allowedIfHasPermission($account ?: Drupal::currentUser(), 'post comments'));
        // $result = AccessResult::forbidden(); // -> I HAVE ADDED THIS TO TEST
      return $return_as_object ? $result : $result->isAllowed();
    return parent::access($operation, $account, $return_as_object);

If I remove/overwrite line 59/60 (or in this case, I overwrite the return of the function with another access opinion), I get my desired functionality. Now, the problem is that it is not ok to edit code inside core as it will be lost with every update. How do I hook into this class in order to rewrite the access function? Or, is there perhaps another approach for the functionality I need (view comments based on which entity they are attached to)?