A new solar cell that comprises a graphene oxide and titanium oxide nanoparticle (NP) composite with graphitized polyaniline (PANI) has been tested in polymer solar cells (PSCs). In this study, a series of conjugated polymers were synthesized and evaluated as the absorber and hole-transport layer materials in organic solar cells, demonstrating the significant impact of the chemical structure of the polymers on solar cell performance. The incorporation of graphene oxide (GOX) and titanium oxide TiO2 NP in conjugated polymers, particularly when graphitized within the PANI layer, led to improved open-circuit voltages compared to structurally similar polymers without NP. The morphology of the composite films was analyzed and related to the photovoltaic performance of polymers synthesized with polyaniline PANI-base and PANI-salt. Optimal NP addition in PANI-salt, PANI-base, PANI-base-TiO2, and PANI-base-GOX resulted in open-circuit voltages and efficiencies of 433 mV and 3.67%, 250 mV and 0.595%, 310 mV and 1.358%, and 520 mV and 2.366%, respectively. This study underscores the importance of polymer film uniformity in the performance of PSCs, with the highest efficiency obtained using a conjugated polymer with the best PANI-salt and PANI-base-GOX films. The research sheds light on the relationship between polymer structure and device photovoltaic performance, which is crucial for the design of new polymeric materials for efficient use and stable OSCs and PSCs.