The square-type nanowire is simulated on the Bethe lattice by using the core-shell structure consisting of the Ising spins. A nanoparticle is formed by placing a spin to the center and four others to the corners of a square. Then, each nanoparticle is combined with two neighboring ones with a perfect alignment of the squares to form the nanowire. Only nearest-neighbor spin interactions, either ferromagnetic or antiferromagnetic type, are allowed. The phase diagrams are calculated by studying the thermal variations of magnetizations for various values of bilinear interactions. It is found that the model gives both second-and first-order phase transitions in addition to the tricritical points and compensation temperatures.