Jump to content


Photo
- - - - -

Changing Title and Metabar position

php title postion meta position template the loop

Best Answer Rob , 25 September 2013 - 05:26 AM

Well, we can try page specific CSS.

 

Is your blog page, for example, dynamic or static?  If static, it will have a page number assigned to in by WordPress.  you can find that by visiting Dashboard > Pages > All Pages.  When you edit the page, you'll see the numeric value of the page in the URL/address bar.  Make a note of it.

 

Then for your Custom Code, prefix it with

.page-id-XX (where XX is the number)

 

This will make sure that those elements you want hidden are only hidden on that one page.  But because blogs are dynamic in nature, even with a static blog page, the actual page number doesn't change even with pagination. So it will work on all the subsequent pages.

 

Since category pages, search results and archives are dynamic and not static, you won't see any changes there from the CSS this way.

 

I hope this helps.

Go to the full post


  • Please log in to reply
10 replies to this topic

#1 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 18 September 2013 - 05:32 PM

Hi guys,

 

I'm trying to change the title and metabar to appear after the post.  So it's a simple format:

 

post

title

metadata

 

However, this has to be done in the loop from what I understand.  My problem is that I don't have any clue how to get to that php file.  Every php file I open in the DMS theme is calling out to another location like, "setup_pagelines_template();".  Where is the template that I need to edit?  ..and upon finding that template, will it be as easy as moving the title and metabar underneath another bit of code, or will I have to make a hook to make it work instead?

 

Appreciate any assistance.



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 19 September 2013 - 02:59 AM

First, you're not supposed to be editing php files. 

 

Can you provide a link and an image of what you want to achieve?

 

I believe this can be achieved with CSS.



#3 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 19 September 2013 - 02:20 PM

gabewad.missionstudio.org

The home page will just display all the posts.  It's essentially a photo blog. 

 

The post will contain images first, then a short write up --end of post.  Then I'd like the title and meta data to appear at the bottom or underneath the post --before all the comments.  Below is a mock up of how I want the home page to appear.

 

09.08.13.ms.redesign.FULL.jpg



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 19 September 2013 - 11:53 PM

This is going to be a considerable undertaking.

 

First, my recommendation is to implement and customize a plugin called Special Recent Posts to your home page at the top of the page.  This would handle your photos.  You'd have it pull the featured image for each post, without title, excerpt, link, date or other meta data.  Just the linked thumbnail (resized using settings and with CSS) would display.  Then, your postloop can be formatted to hide the thumbnail, and display title, excerpt and meta.  In essence, this would be below the last featured image, as you desire.

 

However, you shouldn't have a comments field on a blog posts page.  People should only post comments on the actual single post, not on groups of posts. I'm not even sure you can add comments there.  If you did, people would be commenting on the collection, but it would never be linkable by visitors as the content would be dynamic.  If someone commented on a great photo of Paris, but the home/blog page showed pictures of Venezuelan beaches, let's say, then their comments will look silly. I'd recommend leaving off the comments.



#5 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 20 September 2013 - 01:11 PM

I appreciate the feedback.. the comments wouldn't be there on the homepage - that was just a mockup showing how I'd want them to appear in the post.

 

That does sound like quite the undertaking.  Perhaps I have an elementary understanding of how this works, but people do put the meta data at the bottom of there posts.  From what I understand, that's not a big deal.  There's some line of code that says get_meta_data and its called out below the post content.  If that is true, can I not just take the line of code and throw it down there with the meta data that says get_post_title?



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 21 September 2013 - 01:16 AM

These are the shortcodes for meta tags

 
[post_categories] - List of categories
[post_edit] - Link for admins to edit the post
[post_tags] - List of post tags
[post_comments] - Link to post comments
[post_author_posts_link] - Author and link to archive
[post_author_link] - Link to author URL
[post_author] - Post author with no link
[post_time] - Time of post
[post_date] - Date of post
[post_type] - Type of post

You can use these anywhere related to a post.

 

Fundamentally, you could add a TextArea to the lower area of a post in DMS, editing a post. In the TextArea, add your meta shortcodes.

 

The CSS to remove the Metabar is:

 
.post-meta .metabar em {
    display: none;
    font-style: normal;
    opacity: 0.7;
}

As for the blog listing, I tested and found that was tough.  Adding the meta shortcodes there was difficult.  It can be done at the end of the excerpt, but other than that, I couldn't add anything easily within the post listing. You'd have to do that with a hook, which can be quite complex.



#7 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 23 September 2013 - 03:26 PM

I think this could work.  So does placing the shortcodes anywhere in the post show the data specific to the post they're in? If that's the case then I could just disable the meta bar as well as the title header with CSS and just type out the title and meta data in the bottom of the post?  That might jack up SEO rating for my site but since it's just a photo blog that's not something I'm particularly worried about.



#8 Jake

Jake

    Advocate

  • Premium
  • 565 posts
  • LocationNC, USA
  • Country: Country Flag

Posted 23 September 2013 - 04:08 PM

Hi @gbouck - I think @Rob is definitely onto something with his suggestion on how to accomplish the look you're going for in the easiest manner. To answer your question - yes, you should start by disabling the default areas with display: none; as he described. And then, if you drag the TextBox section into the bottom part of your Content/PostLoop section and add the meta tags you choose, they will display the data specific to each particular post.



#9 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 24 September 2013 - 08:05 PM

Well it works out perfectly for the posts.  However.. hiding the title and meta data with the css removes it from everywhere.  This is only a problem because I have my archive page linking to: http://gabewad.missi...category/photo/.  This would normally show the pictures with title and meta data below that.. so now it's just a page of thumbnails.

 

Is there an easy way around this?  I can't really edit the archive page content.. I'm wondering if I can separate the class defining archive titles from the post titles.



#10 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 September 2013 - 05:26 AM   Best Answer

Well, we can try page specific CSS.

 

Is your blog page, for example, dynamic or static?  If static, it will have a page number assigned to in by WordPress.  you can find that by visiting Dashboard > Pages > All Pages.  When you edit the page, you'll see the numeric value of the page in the URL/address bar.  Make a note of it.

 

Then for your Custom Code, prefix it with

.page-id-XX (where XX is the number)

 

This will make sure that those elements you want hidden are only hidden on that one page.  But because blogs are dynamic in nature, even with a static blog page, the actual page number doesn't change even with pagination. So it will work on all the subsequent pages.

 

Since category pages, search results and archives are dynamic and not static, you won't see any changes there from the CSS this way.

 

I hope this helps.



#11 gbouck

gbouck

    Member

  • Members

  • 11 posts
  • Country: Country Flag

Posted 01 October 2013 - 09:24 PM

Thanks guys. Definitely making some progress from this discussion.  I'll be sure to check back if anything else comes up!  Really appreciate all the support.







Also tagged with one or more of these keywords: php, title postion, meta position, template, the loop