Porous silicon-based photonic crystals of finite thickness were designed aiming at their subsequent use in the field of optical chemical- and bio-sensing. These structures consist in nanometric porous silicon rods arranged as to form a triangular lattice embedded into a silicon slab. These structures have two-dimensional periodicity and index-guiding is used to confine light in the third dimension. This way, the fabrication of photonic crystals in thin dielectric slab systems is enabled. The photonic band structure for the odd and even modes was calculated as a function of the thickness of the slab, finding a significant dependence on this parameter. The existence of a photonic bandgap for even modes was verified and its size was maximized. A change in the index of refraction of porous silicon caused by infiltration with chemical or biochemical species changes the band structure.