Forum Replies Created
-
AuthorPosts
-
Badlywired
MemberOK wordpress has jquery-masonary built in
see https://codex.wordpress.org/Function_Reference/wp_enqueue_scriptenqueue it
then write a custom loop to ensure you build the right sized bricks in the right sequence (if you care i.e small x 4, big, horiz, horiz )
and add a bit of jquery to fires it all up
This tutorial should get you closer http://code.tutsplus.com/tutorials/using-jquery-masonry-for-pinterest-like-posting--wp-29556
In this site http//:fullworlks.net I'm using the same principals (but using 'isotope' library) and using 'post format' amd 'menu order' on the post to determine order / size
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberThe minimum you have to do is change the detail in the first few lines of the style.css
If you want to do a 'proper job' you should also search and replace 'agency-pro' with your name and also do a quick read through of the files.
My techy blog WordPress and stuff badlywired.com
May 4, 2015 at 3:44 pm in reply to: Possible to create Custom Post Layout for certain posts? #150122Badlywired
MemberYou want me to educate your web dev?
It would depend on your detailed requirements, but if it is as simple as you state 'for certain articles' I might use post formats to enable a specific designs per post see https://codex.wordpress.org/Post_Formats
An alternative would be to use a specific 'tag' or 'category' and when the post is in that 'tag' or 'category' is in play displaythe specific layout.
Or thirdly, I might use a custom metabox to select the post styling.
So there are at least 3 ways of doing this. It will take some coding, not just select an option.
What your web dev might be saying is
1) they don't know wordpress (at a coding level)
or
2) you are not paying them enough to do this level of customisation
My techy blog WordPress and stuff badlywired.com
Badlywired
Membersome css
on your home page it has
.home .featured-content .entry { border-bottom: 1px solid #ddd; }
If you want to apply that to your blog template page (as per the link)
.page-template-page_blog .featured-content .entry { border-bottom: 1px solid #ddd; }
My techy blog WordPress and stuff badlywired.com
May 4, 2015 at 3:17 pm in reply to: Possible to create Custom Post Layout for certain posts? #150118Badlywired
MemberBadlywired
MemberH James,
As you clearly as just learning development you may find it easier with a plugin like 'Genesis Essentials'.
(see the first link in the header of my site https://badlywired.com )
Alan
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberI answered a very similiar question here, should give you the answer, if not come back and give a bit more detail about your question.
http://www.studiopress.community/topic/load-script-if-not-logged-in/
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberJust use the standard register_post_type(), register_taxonomy() and add_post_type_support() functions as per WordPress codex in your functions.php.
As far as custom fields go, lots use Advanced Custom Fields plugin (ACF) however code junkies that don't want or like GUIs go for Custom Meta Boxes 2 (CMB2) https://github.com/webdevstudios/CMB2
All plays nicely with Genesis.
My techy blog WordPress and stuff badlywired.com
Badlywired
Member@te1 unfortunately I can't debug your code remotely, or free. I think you have enough pointers to get on with it.
I'm sure you are a competent coder judging by the code you posted initially.
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberCome on @tel thats your code error that I just copied from your post!!
$attributes['class'] .= ' ', array( 'class' => $typename);
spot the comma that should be a dot!
$attributes['class'] .= ' '. array( 'class' => $typename);
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberIf you go the filter route
something like
add_filter( 'genesis_attr_entry', 'custom_attributes_entry' ); function custom_attributes_entry( $attributes ) { global $post; // your code which I think is wrong as it returns all terms $terms = get_terms( 'sa_tax_sources' ); $typename = $terms[0]->name; // end of your code $attributes['class'] .= ' ', array( 'class' => $typename); return $attributes; }
my version would be (assuming you only want the terms for that post
add_filter( 'genesis_attr_entry', 'custom_attributes_entry' ); function custom_attributes_entry( $attributes ) { global $post; // my code - but I am guess what you really are trying to do $terms = wp_get_post_terms( $post->ID, 'sa_tax_sources' ); $typename = implode(' ',$terms); // end of your code $attributes['class'] .= ' ', array( 'class' => $typename); return $attributes; }
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberOK ignore my answer that is right and try rens, that he already said doesn't apply
--------------------------
by the way ...
More of a wordpress question rather than Genesis, however I think you are using the wrong function as you are in the loop and I assume you want the taxonomy term used on that specific post, not all of them?
have a look at wp_get_post_terms()
https://codex.wordpress.org/Function_Reference/wp_get_post_terms
which will return an array of terms for the post and then you will need to process that, maybe with implode
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberBadlywired
MemberBadlywired
MemberHaving read your code, I think this is the solution
printf( '<article %s>', genesis_attr( 'entry', array('class' =>$typename )) );
ass genesis attr takes an array of any attribute, not just class
My techy blog WordPress and stuff badlywired.com
Badlywired
Memberlol
Under the title is a check box 'Open links in new window?'. Tick that !
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberCheck your wp-config.php as at some time some one may have 'hardened' your site
as per http://codex.wordpress.org/Hardening_WordPress#Disable_File_Editing
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberOK (untested but should work unless I have made a typo)
add_action ('genesis_doctype','myscript',20); function myscript() { if ( !is_user_logged_in() ) { ?> <script src=”//cdn.optimizely.com/js/2801570498.js”></script> <?php } }
can also be written
add_action ('genesis_doctype','myscript',20); function myscript() { if ( !is_user_logged_in() ) { echo '<script src=”//cdn.optimizely.com/js/2801570498.js”></script>'; } }
The ?> ends php and switches to just html output and <?php restarts the php
the second version just uses php and echos the html - it does the same thing
My techy blog WordPress and stuff badlywired.com
Badlywired
MemberBadlywired
MemberGenesis is very much (in my opinion) a developer framework. If you are comfortable with PHP / HTML / CSS and jQuery and the WordPress Codex you will get along fine once you have studied the Genesis Hooks.
If you are not a developer but more used to premium themes, then you might look at Dynamik which makes Genesis a bit more friendly.
My techy blog WordPress and stuff badlywired.com
-
AuthorPosts