[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need help with php (I think) in my wordpress custom themed site. Please help!

Posted on 2012-09-21
12
Medium Priority
?
1,189 Views
Last Modified: 2012-09-26
Ok so in a nutshell, we purchased this theme: http://www.templatemonster.com/demo/39178.html but the home page images were linking to posts and not pages like we wanted them to. And it was pulling the images from the portfolio posts through a customized post cycle widget. So every time a new portfolio page was added, the links would change.

So I posted on experts-exchange and one of the experts told me to make a custom post type and mentioned something about changing the loop for it to work. So I went into the theme-init.php and added a custom post type named homeposts. Then I made 8 posts and set the featured image and published them. Then I went into the style.css file and duplicated the portfolio styles that were called in the widget and created new identical styles but renamed them with homeposts instead of porfolio. Then lastly I went into the my-post-cycle-widget.php file and duplicated the porfolio section of the widget and named it homeposts and changed any corresponding portfolio css calls to homepost css stuff. My thinking was that if I just duplicate the settings in both the style.css and my-post-cyce-widget.php files for the portfolio then I can use the new homeposts in exactly the same way. So after I uploaded these new files to wordpress everything was working fine. My home images were now linking to pages like I wanted. Without the custom thumbs the images are exactly the same size and line up in a row. So I went in and added the custom thumbs so I could get the same look as the demo and it doesn't look the same as the demo. I must have missed something. Somewhere. I hope I explained this correctly. I have attached the my-post-cycle-wiget.php file and the style.css file and the theme-init.php file in case anyone needs to look at it. The top row of images is the same as the demo but the bottom row isn't.

Here is the link to the demo again:
http://www.templatemonster.com/demo/39178.html

And here is the site I am working on:
http://www.g3creative.com/g3wp55/
0
Comment
Question by:designrox
  • 6
  • 3
10 Comments
 

Author Comment

by:designrox
ID: 38423866
I tried attaching the files but kept receiving an error. I will try again. But hopefully someone can look at this and help me out? Please help!
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 38424655
Try attaching dropping the files in drop box if you can't attach using the file upload.
0
 

Author Comment

by:designrox
ID: 38429291
I was able to attach the files I edited below.
style.css
theme-init.php
my-post-cycle-widget.php
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 38433454
There is problems with your CSS.  Your homeposts_item DIV's need to have the correct inline style ("position: absolute; top: 240px; left: 0px;").  The 'top' and 'left' vary depending on the position of the thumbnail.
0
 

Author Comment

by:designrox
ID: 38433732
I see what you are saying but I duplicated the styles for the folio.cycle and just renamed it to homeposts so shouldn't it have worked the exact same way? I did that for all of the folio things on the style sheet and the widget php file and the init file. Also, when the featured image is not defined, the thumbnails all line up correctly so I am still confused as to why it doesn't work correctly.
0
 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 38433929
Can you post the original my-post-cycle-widget.php?

The page on template monster has an inline style and another class (masonry-brick) for the thumbnail DIV's that are not on your page.

Template Monsters:
<div class="folio_item masonry-brick" style="position: absolute; top: 0px; left: 0px;">

Yours:
<div class="homeposts_item">
0
 

Author Comment

by:designrox
ID: 38433961
Sure! Good idea! I have attached all 3 original files here.
style.css
theme-init.php
my-post-cycle-widget.php
0
 
LVL 14

Accepted Solution

by:
CtrlAltDl earned 2000 total points
ID: 38439022
I can't find it in the files you posted, but there is some JQuery code that needs to have 'folio' renamed.

In the rendered web page it's on line 89-99.

  <script type="text/javascript">
            jQuery(window).load(function() {
                  jQuery(function(){
                    jQuery('#folio-cycle').masonry({
                      // options
                      isAnimated: true,
                      itemSelector : '.folio_item',
                      columnWidth : 10,
                      animationOptions: {
                            duration: 400
                          }
                    });
                  });
            });
      </script>

It should be modified like this:

  <script type="text/javascript">
            jQuery(window).load(function() {
                  jQuery(function(){
                    jQuery('#homeposts-cycle').masonry({
                      // options
                      isAnimated: true,
                      itemSelector : '.homeposts_item',
                      columnWidth : 10,
                      animationOptions: {
                            duration: 400
                          }
                    });
                  });
            });
      </script>
0
 

Author Comment

by:designrox
ID: 38439064
THAT WAS THE LAST STEP!!!!!!!! THANK YOU SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
MUCH! I WISH I COULD GIVE YOU A MILLION POINTS!
0
 

Author Closing Comment

by:designrox
ID: 38439065
I really appreciate the time it took for you to look through my code and help me out. You are a lifesaver!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question